1. CR/LF
- Posted by Michael Sabal <mjs at OSA.ATT.NE.JP> Jan 03, 1999
- 493 views
I apologize for my error about newline being ASCII 10/13. It comes from = trying to do too many things at once and not thinking carefully. The = method for generating newlines in MLE's in Windows is accurate. DOS = text files end a line with ASCII 13/10 as stated by others (as I = silently take my foot out of my mouth -- needs a little sugar next time = :) UNIX / Linux text files end with just ASCII 10. =20 <Small note for people wanting to try Peuphoria on Linux> Don't forget to use this command on peu.c before compiling to remove the = extra 13's: tr -d "\r" < peu.c > peu2.c [Disclaimer -- I'm not responsible for more typos (mine), so make a = backup copy first :)] </end small note> I know that \r =3D carriage return =3D ASCII 13. So if \n =3D newline = !=3D 13&10, what is it's true value? Michael J. Sabal mjs at osa.att.ne.jp http://home.att.ne.jp/gold/mjs/index.html
2. Re: CR/LF
- Posted by Ralf Nieuwenhuijsen <nieuwen at XS4ALL.NL> Jan 03, 1999
- 533 views
>I know that \r = carriage return = ASCII 13. So if \n = newline != 13&10, what is it's true value? \n = ASCII 13 \r = ASCII 10 When reading in a file in text mode (i.e. normal mode, opened without a 'b' in the mode sequece) then \r is removed when found after a \n automatically. Simerlar \r is added, when you write a \n in text mode. Why ? \r is DOS/IBM-Pc specific. You could in theory write programs that will work under UNIX (when Euphoria supports that.. or with.. Peu) with text files without any problem, eventhough under UNIX text files are slightly different formatted. An \n indicated jump to next line in Euphoria, however no action is associated with \r, however its an common used 'end-of-line' terminator. Ralf PS Robert I assume new versions of Euphoria handle '0' better ? (maybe using a new version of puts.. rather than building the whole text sequence, no slow dynamic trick is needed when putsing everything one character at a time, or better yet, blocks of 4)