Board index » delphi » new line carriage return : strange behaviour

new line carriage return : strange behaviour

Hi

I have noticed a rather strange behaviour of an application I wrote on
NT.

It is a simple application dealing with text files.
A string is written char by char to a text file - at the end of the line
#10 #13

On some PC's everything works fine. The text shows correct formating.
:-) !
But ! :-| !  On some machines (NT )  the #10 #13 does not show an
influence on the
lines in the text ...the whole string appears on the same line ! :-( !

Is there somebody who can tell me what could be wrong with those PC's ?
I'm 100% shure that the code does the right things !
By the way I converted the strings from ASCII to ANSI ...just for test
...but still the same behaviour.

Any help will be appreciated !
Thanks !

Guido

 

Re:new line carriage return : strange behaviour


The order is normally #13 #10 (not #10 #13).
Could that be your problem.

Guido Steiner <s...@zhwin.ch> skrev i en
nyhedsmeddelelse:37A70724.6EFF0...@zhwin.ch...

Quote
> Hi

> I have noticed a rather strange behaviour of an application I wrote on
> NT.

> It is a simple application dealing with text files.
> A string is written char by char to a text file - at the end of the line
> #10 #13

> On some PC's everything works fine. The text shows correct formating.
> :-) !
> But ! :-| !  On some machines (NT )  the #10 #13 does not show an
> influence on the
> lines in the text ...the whole string appears on the same line ! :-( !

> Is there somebody who can tell me what could be wrong with those PC's ?
> I'm 100% shure that the code does the right things !
> By the way I converted the strings from ASCII to ANSI ...just for test
> ...but still the same behaviour.

> Any help will be appreciated !
> Thanks !

> Guido

Re:new line carriage return : strange behaviour


Im Artikel <37A70724.6EFF0...@zhwin.ch>, Guido Steiner <s...@zhwin.ch> schreibt:

Quote
>A string is written char by char to a text file - at the end of the line
>#10 #13

Reverse the two bytes, and it should work. Or, when using TEXT files, use
WriteLn to store the appropriate EOL byte(s).

The order comes from old Teletype machines, where a carriage return (CR=#13) in
most cases took more time than a line feed (LF=#10), so the CR was sent first.

Unix files usually will omit the CR, and have only a LF as the End Of Line, and
also may confuse WinDos.

DoDi

Other Threads