jensborrisholt / delphiconsole Goto Github PK
View Code? Open in Web Editor NEWThe Console class from C# ported to Delphi
License: MIT License
The Console class from C# ported to Delphi
License: MIT License
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
Nothing is written to a stream, instead everything is written to the console.
https://learn.microsoft.com/en-us/windows/console/writeconsole
The issue with this is that redirecting (app.exe > log.txt) DOESN't work...
I know C# has the same issue, but it breaks normal use where redirection is used like the standard Pascal Write/Writeln functions...
I'm currently looking into this because redirection is needed...
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
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?
This is an excellent project, nothing like this in the Delphi community as far as I know.
Not sure what's the target compiler, but when compiling under xe4, I got the following error:
[dcc32 Error] System.Console.pas(83): E2003 Undeclared identifier: 'vkPeriod'
Would appreciate a fix :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.