Date : Sat, 22 Sep 1990 16:48:02 GMT
From : crash!mwilson@nosc.mil (Marc Wilson)
Subject: How "hard" is CR-LF
In article <josef.653915275@peun11> josef@nixpbe.UUCP (Moellers) writes:
>Hi,
>Can somebody tell me how "hard" the CR/LF sequence is built into CP/M?
>I'm asking this as I want to read a text-file line by line and need a
>definite place to terminate the line.
It's not built into CP/M at all. It's just that most terminals
and hardcopy drvices of the time required both the CR and the LF to
get to the first position on the next line.
>UNIX uses a single \n, but with a two character sequence, I'm not sure
>if LF is always the last character and the second last character is
>always a CR which I can discard.
Why don't you just scan for the CR? If you find one, then look
at the next character. If it's a LF, then throw it away. If it's
not, you've got a weird file.
You could always therminate the line at 80 characters or CR,
whichever comes first.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Marc Wilson
ARPA: ...!crash!mwilson@nosc.mil
...!crash!pnet01!pro-sol!mwilson@nosc.mil
UUCP: [ cbosgd | hp-sdd!hplabs | sdcsvax | nosc ]!crash!mwilson
INET: mwilson@crash.CTS.COM
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Marc Wilson
ARPA: ...!crash!mwilson@nosc.mil
...!crash!pnet01!pro-sol!mwilson@nosc.mil
UUCP: [ cbosgd | hp-sdd!hplabs | sdcsvax | nosc ]!crash!mwilson
INET: mwilson@crash.CTS.COM
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~