Giter VIP home page Giter VIP logo

delphiconsole's Introduction

DelphiConsole

The Console class from C# ported to Delphi

/*=============================================================================
**
** Class: Console
**
**
** Purpose: This class provides access to the standard input, standard output
**          and standard error streams.
**
**
=============================================================================*/

Properties

Name

Description

BackgroundColor Gets or sets the background color of the console.
BufferHeight Gets or sets the height of the buffer area.
BufferWidth Gets or sets the width of the buffer area.
CapsLock Gets a value indicating whether the CAPS LOCK keyboard toggle is turned on or turned off.
CursorLeft Gets or sets the column position of the cursor within the buffer area.
CursorSize Gets or sets the height of the cursor within a character cell.
CursorTop Gets or sets the row position of the cursor within the buffer area.
CursorVisible Gets or sets a value indicating whether the cursor is visible.
Error Gets the standard error output stream.
ForegroundColor Gets or sets the foreground color of the console.
In Gets the standard input stream.
InputEncoding Gets or sets the encoding the console uses to read input.
IsErrorRedirected Gets a value that indicates whether the error output stream has been redirected from the standard error stream.
IsInputRedirected Gets a value that indicates whether input has been redirected from the standard input stream.
IsOutputRedirected Gets a value that indicates whether output has been redirected from the standard output stream.
KeyAvailable Gets a value indicating whether a key press is available in the input stream.
LargestWindowHeight Gets the largest possible number of console window rows, based on the current font and screen resolution.
LargestWindowWidth Gets the largest possible number of console window columns, based on the current font and screen resolution.
NumberLock Gets a value indicating whether the NUM LOCK keyboard toggle is turned on or turned off.
Out Gets the standard output stream.
OutputEncoding Gets or sets the encoding the console uses to write output.
Title Gets or sets the title to display in the console title bar.
TreatControlCAsInput Gets or sets a value indicating whether the combination of the Control modifier key and C console key (Ctrl+C) is treated as ordinary input or as an interruption that is handled by the operating system.
WindowHeight Gets or sets the height of the console window area.
WindowLeft Gets or sets the leftmost position of the console window area relative to the screen buffer.
WindowTop Gets or sets the top position of the console window area relative to the screen buffer.
WindowWidth Gets or sets the width of the console window.

Methods

Name

Description

Beep() Plays the sound of a beep through the console speaker.
Beep(Int32, Int32) Plays the sound of a beep of a specified frequency and duration through the console speaker.
Clear() Clears the console buffer and corresponding console window of display information.
MoveBufferArea(Int32, Int32, Int32, Int32, Int32, Int32) Copies a specified source area of the screen buffer to a specified destination area.
MoveBufferArea(Int32, Int32, Int32, Int32, Int32, Int32, Char, ConsoleColor, ConsoleColor) Copies a specified source area of the screen buffer to a specified destination area.
OpenStandardError() Acquires the standard error stream.
OpenStandardError(Int32) Acquires the standard error stream, which is set to a specified buffer size.
OpenStandardInput() Acquires the standard input stream.
OpenStandardInput(Int32) Acquires the standard input stream, which is set to a specified buffer size.
OpenStandardOutput() Acquires the standard output stream.
OpenStandardOutput(Int32) Acquires the standard output stream, which is set to a specified buffer size.
Read() Reads the next character from the standard input stream.
ReadKey() Obtains the next character or function key pressed by the user. The pressed key is displayed in the console window.
ReadKey(Boolean) Obtains the next character or function key pressed by the user. The pressed key is optionally displayed in the console window.
ReadLine() Reads the next line of characters from the standard input stream.
ResetColor() Sets the foreground and background console colors to their defaults.
SetBufferSize(Int32, Int32) Sets the height and width of the screen buffer area to the specified values.
SetCursorPosition(Int32, Int32) Sets the position of the cursor.
SetError(TextWriter) Sets the Error property to the specified TextWriter object.
SetIn(TextReader) Sets the In property to the specified TextReader object.
SetOut(TextWriter) Sets the Out property to the specified TextWriter object.
SetWindowPosition(Int32, Int32) Sets the position of the console window relative to the screen buffer.
SetWindowSize(Int32, Int32) Sets the height and width of the console window to the specified values.
Write(Boolean) Writes the text representation of the specified Boolean value to the standard output stream.
Write(Char) Writes the specified Unicode character value to the standard output stream.
Write(Char[]) Writes the specified array of Unicode characters to the standard output stream.
Write(Char[], Int32, Int32) Writes the specified subarray of Unicode characters to the standard output stream.
Write(Decimal) Writes the text representation of the specified Decimal value to the standard output stream.
Write(Double) Writes the text representation of the specified double-precision floating-point value to the standard output stream.
Write(Int32) Writes the text representation of the specified 32-bit signed integer value to the standard output stream.
Write(Int64) Writes the text representation of the specified 64-bit signed integer value to the standard output stream.
Write(Object) Writes the text representation of the specified object to the standard output stream.
Write(Single) Writes the text representation of the specified single-precision floating-point value to the standard output stream.
Write(String) Writes the specified string value to the standard output stream.
Write(String, Object) Writes the text representation of the specified object to the standard output stream using the specified format information.
Write(String, Object, Object) Writes the text representation of the specified objects to the standard output stream using the specified format information.
Write(String, Object, Object, Object) Writes the text representation of the specified objects to the standard output stream using the specified format information.
Write(String, Object, Object, Object, Object) Writes the text representation of the specified objects and variable-length parameter list to the standard output stream using the specified format information.
Write(String, Object[]) Writes the text representation of the specified array of objects to the standard output stream using the specified format information.
Write(UInt32) Writes the text representation of the specified 32-bit unsigned integer value to the standard output stream.
Write(UInt64) Writes the text representation of the specified 64-bit unsigned integer value to the standard output stream.
WriteLine() Writes the current line terminator to the standard output stream.
WriteLine(Boolean) Writes the text representation of the specified Boolean value, followed by the current line terminator, to the standard output stream.
WriteLine(Char) Writes the specified Unicode character, followed by the current line terminator, value to the standard output stream.
WriteLine(Char[]) Writes the specified array of Unicode characters, followed by the current line terminator, to the standard output stream.
WriteLine(Char[], Int32, Int32) Writes the specified subarray of Unicode characters, followed by the current line terminator, to the standard output stream.
WriteLine(Decimal) Writes the text representation of the specified Decimal value, followed by the current line terminator, to the standard output stream.
WriteLine(Double) Writes the text representation of the specified double-precision floating-point value, followed by the current line terminator, to the standard output stream.
WriteLine(Int32) Writes the text representation of the specified 32-bit signed integer value, followed by the current line terminator, to the standard output stream.
WriteLine(Int64) Writes the text representation of the specified 64-bit signed integer value, followed by the current line terminator, to the standard output stream.
WriteLine(Object) Writes the text representation of the specified object, followed by the current line terminator, to the standard output stream.
WriteLine(Single) Writes the text representation of the specified single-precision floating-point value, followed by the current line terminator, to the standard output stream.
WriteLine(String) Writes the specified string value, followed by the current line terminator, to the standard output stream.
WriteLine(String, Object) Writes the text representation of the specified object, followed by the current line terminator, to the standard output stream using the specified format information.
WriteLine(String, Object, Object) Writes the text representation of the specified objects, followed by the current line terminator, to the standard output stream using the specified format information.
WriteLine(String, Object, Object, Object) Writes the text representation of the specified objects, followed by the current line terminator, to the standard output stream using the specified format information.
WriteLine(String, Object, Object, Object, Object) Writes the text representation of the specified objects and variable-length parameter list, followed by the current line terminator, to the standard output stream using the specified format information.
WriteLine(String, Object[]) Writes the text representation of the specified array of objects, followed by the current line terminator, to the standard output stream using the specified format information.
WriteLine(UInt32) Writes the text representation of the specified 32-bit unsigned integer value, followed by the current line terminator, to the standard output stream.
WriteLine(UInt64) Writes the text representation of the specified 64-bit unsigned integer value, followed by the current line terminator, to the standard output stream.

delphiconsole's People

Contributors

gchicks50 avatar jensborrisholt avatar luebbe avatar pethical avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

delphiconsole's Issues

Question about GuiAndConsole

Whenever an application is compiled as a gui app, there is no problem to attach this application to to the parent console and send output to it.
But - and this effect is also visible in the GuiAndConsole demo - the parent console seems to have no idea that there was some text output and that the current cursor position and prompt should be e.g. 5 or 500 lines further down.

If you run GuiAndConsole and press Enter when done, the dos prompt shows up in the middle of the text that was output in the console window by the demo.
Do you have any idea how to tell the parent console where the prompt and cursor should be? Is this possible?

FixInsight warnings

Hi Jens,

I ran FixInsight over the System.Console unit and it reported a number of warnings. Would you accept a PR that fixes these?
I didn't take a look if they can all be fixed easily.

Here's the complete list:

[FixInsight Convention] System.Console.pas(932): C101 Method 'Console.MoveBufferArea' is too long (62 lines)
[FixInsight Convention] System.Console.pas(923): C102 Too many parameters in 'Console.MoveBufferArea' (9 parameters)
[FixInsight Convention] System.Console.pas(923): C103 Too many variables in 'Console.MoveBufferArea' (10 variables)
[FixInsight Convention] System.Console.pas(346): C104 Class name 'Console' should start with 'T'
[FixInsight Convention] System.Console.pas(348): C107 Class field name 'DefaultTextAttributes' should start with 'F'
[FixInsight Convention] System.Console.pas(351): C107 Class field name 'StdErr' should start with 'F'
[FixInsight Convention] System.Console.pas(352): C107 Class field name 'StdIn' should start with 'F'
[FixInsight Convention] System.Console.pas(353): C107 Class field name 'StdOut' should start with 'F'
[FixInsight Convention] System.Console.pas(354): C107 Class field name 'TextAttr' should start with 'F'
[FixInsight Warning] System.Console.pas(1001): W517 Variable 'StdIn' hides a class field, method or property
[FixInsight Warning] System.Console.pas(1168): W517 Variable 'ConsoleCursorInfo' hides a class field, method or property
[FixInsight Warning] System.Console.pas(996): W521 Return value of function 'Console.ReadKey' might be undefined
[FixInsight Warning] System.Console.pas(1352): W521 Return value of function 'Console.WriteString' might be undefined
[FixInsight Optimization] System.Console.pas(1023): O801 CONST missing for unmodified string parameter 'aCaller'
[FixInsight Optimization] System.Console.pas(1324): O801 CONST missing for unmodified string parameter 'aFontName'
[FixInsight Optimization] System.Console.pas(1352): O801 CONST missing for unmodified string parameter 'aValue'
[FixInsight Optimization] System.Console.pas(499): O804 Method parameter 'ALockObject' is declared but never used
[FixInsight Optimization] System.Console.pas(504): O804 Method parameter 'ALockObject' is declared but never used
[FixInsight Optimization] System.Console.pas(504): O804 Method parameter 'ATimeout' is declared but never used
[FixInsight Optimization] System.Console.pas(1046): O804 Method parameter 'Intercept' is declared but never used
[FixInsight Optimization] System.Console.pas(1349): O805 Inline marked routine 'Console.WriteString' comes after its call in the same unit

Error

Delphi 10.2
demo under debug !!!!
system error 87
parameter is incorrect

procedure TPixel.SetPos(AxPos, AyPos: Integer);
var
OldVisible: Boolean;
begin
OldVisible := Visible;

try
Visible := False; <<<<<<< error

and took it off then game start and again
same error

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.