[fpc-pascal]CR / CRLF problem when redirecting to file

Jonas Maebe jonas.maebe at elis.ugent.be
Sun Sep 14 17:57:57 CEST 2003

On zondag, sep 14, 2003, at 17:48 Europe/Brussels, John Coppens wrote:

> In Linux, when redirecting FPC output to a file, I found that after 25
> lines, CR characters are being added, as if in DOS:
> program TestCR;
> uses
>   CRT;

That's because you are using the crt unit. The crt unit is only meant 
for screen display, it has to use all sorts of tricks on a *nix console 
(setting it to raw mode, for instance). That's why you get garbage if 
you redirect it to a file.


More information about the fpc-pascal mailing list