I am working on a Delphi project for the first time, I used to develop on Java.
Is there a way to print in delphi's console like in java.
System.out.println("Message");
which I used to test code and find bugs (primitively).
I am working on a Delphi project for the first time, I used to develop on Java.
Is there a way to print in delphi's console like in java.
System.out.println("Message");
which I used to test code and find bugs (primitively).
You must use Writeln
(only for console applications).
{$APPTYPE CONSOLE}
begin
Writeln('Hello');
Readln;
end.
If you want to put a string in the IDE's event log, you can use the OutputDebugString
function.
I usually use the following code for "debugging" my programs.
showmessage('Hello World');
That's how i do it.. :)
If you want something similar to Java console, you can use CodeSite, which uses an independent viewer
Another similar tool is TraceTool
More logging libraries on this question - Which logging library is better?
For debugging messages there is also the GExperts console to which you can write using the SendXXX procedures in GX_DbugIntf. This unit is part of the GExperts source code which is available on SourceForge.