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

John Coppens john at jcoppens.com
Sun Sep 14 19:42:26 CEST 2003


On Sun, 14 Sep 2003 17:57:57 +0200
Jonas Maebe <jonas.maebe at elis.ugent.be> wrote:

> 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.
> 
> 
> Jonas

Hello Jonas.

Is there no elegant solution to this? I use a library of mine that does
some screen operations, like gotoxy, and includes the CRT library. So,
even if I only use hex output from that library, I still get CRT for free.
I could seperate those routines, but that CRT library would always dangle
there as a Damocles's sword...

I'm no expert - doesn't the forms library do something similar as the crt
library?

John




More information about the fpc-pascal mailing list