DelphiFAQ Home Search:
General :: Programming :: Delphi
General Delphi related information.

Articles:

This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.
Recommended links on this topic:
Featured Article

Have a Delphi application write to standard error output (STDERR)

Question:

WriteLn writes to STDOUT. How do I write to STDERR, the standard error output?

Answer:

Use the predefined text file variable ErrOutput as shown in the example code below. This has been around since Turbo Pascal 1.0.

// standard output, the next two are equivalent
 WriteLn('Standard Output');
 WriteLn(Output, 'Standard Output');
 
 // writing to standard error output
 WriteLn(ErrOutput, 'Error Output');
 

Generated 8:01:39 on Apr 24, 2018