[fpc-pascal] Problems with writing to console

Michael Van Canneyt michael at freepascal.org
Wed Jan 10 01:15:59 CET 2018

On Tue, 9 Jan 2018, Darius Blaszyk wrote:

> Hi,
> I have been mixing "writeln(StdOut" and regular writeln in my
> application (actually a couple of applications working together) and
> found that the output on the console is mangled when I do that. Output
> is being overwritten and placed semi randomly on the console. What is
> the standard output for writeln? I thought it would be StdOut as the
> name suggests. Using StdOut at the same time will not allow colors
> (TextColor) from the crt unit to be shown on the console. On the other
> hand reading output from the console does require writing to StdOut.

Take care, stdout and output are not the same text file.

if no file is specified, then output is assumed.

The crt unit only redirects output. not stdout.
(See around line 438 of crt.inc)

using crt and output redirection together is not supported.


More information about the fpc-pascal mailing list