[Lazarus] DebugLn vs writeln

Bernd prof7bit at googlemail.com
Sat Oct 15 12:18:37 CEST 2011


2011/10/4 Vincent Snijders <vincent.snijders at gmail.com>:

> A writeln would crash a windows GUI application, that is the reason
> why debugln was invented.

How about making a unit (and make it part of the official LCL) that
would automatically redirect stdout (so one could simply use writeln
everywhere) and redirect it to debugln and optionally to the
debugserver (the one that comes with Lazarus) and to
OutputDebugMessage() if it is compiled on windows? Then one would just
have to put this unit into the uses section and from then on writeln()
would always do the correct (most useful) thing on every platform.




More information about the Lazarus mailing list