Delphi coding hints and tips.

Using 'Generate Console Application' as a simple debug window

If you ever need a quick and simple method of getting some debug infomation out of you application as it runs then switch on the 'Generate Console Application' option in the Project | Options.. dialog Linker tab.

Then when you application runs a console (DOS) window will also be created. You can then write messages to it by calling the Write and WriteLn functions within your application, for example;

WriteLn( 'I am here !' );

When you have finished swicth off the 'Generate Console Application' options and remove all calls to Write and / or WriteLn. If you leave the calls to Write or WriteLn you will get a I/O error.