Newsgroups: comp.os.cpm Path: utzoo!telly!lethe!druid!darcy From: darcy@druid.uucp (D'Arcy J.M. Cain) Subject: Re: How "hard" is CR-LF Organization: D'Arcy Cain Consulting, West Hill, Ontario Distribution: comp Date: Mon, 24 Sep 90 00:20:57 GMT Message-ID: <1990Sep24.002057.20032@druid.uucp> References: In article 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. >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. > A quick and dirty method that I have used successfully in both DOS and CP/M is to simply ignore CRs and use \n as the line terminator. This will work most of the time. It even ports to Unix unchanged although it is a little wasteful of the CPU checking for non-existent CRs. -- D'Arcy J.M. Cain (darcy@druid) | D'Arcy Cain Consulting | MS-DOS: The Andrew Dice Clay West Hill, Ontario, Canada | of operating systems. + 416 281 6094 |