[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Help with replacing LFs with CRs for //e
- Subject: Re: Help with replacing LFs with CRs for //e
- From: mjmahon@aol.com (Michael J. Mahon)
- Date: 12 Sep 2003 19:20:47 GMT
- Newsgroups: comp.sys.apple2
- Organization: AOL http://www.aol.com
- References: <_cl8b.946622$3C2.21479447@news3.calgary.shaw.ca>
- Xref: archiver1.google.com comp.sys.apple2:34865
Mike Pfaiffer wrote:
> Simple Applesoft program. I presume you can write the program on your
>own
>if I give you directions.
>
>1) Take care of opening the input file and an output file.
>2) Read in a single character from the input file
>3a) If there is an error then close both files (end of file) and go to
>step 5
>3b) Compare the input character to chr$(10) - if it is then send chr$(13)
>to the output file
>3c) If the input character isn't chr$(10) then send it to the output file
>4) Start over with step 2
>5) Do what you want with the two files
>
>
> This program is very slow. There is a ProDOS call which allows the
>end of
>line character to be changed. You may consider using this to change it to
>chr$(10) and performing an input rather than a get. Then use a print with
>a ";" (no end of line) then manually insert the chr$(13) with a ";". This
>should be faster.
Or just write the line with a print with no ";"--that will write the line with
an appended CR ($13).
I didn't realize that ProDOS supported changing the "end-of-record"
delimiter. Interesting.
-michael
Check out amazing quality sound for 8-bit Apples on my
Home page: http://members.aol.com/MJMahon/