[comp.sys.apple] Writing ^D into a file

mdavis@pro-sol.cts.COM (Morgan Davis) (01/09/88)

Due to the I/O scheme that DOS 3.3 and ProDOS BASIC use to intercept disk
commands, you simply can't print any string of text that contains a Control-D
to a file from within ProDOS BASIC.  Can't be done.

But, you can easily poke a small machine language routine into memory at,
say, location 768 ($300) which will write a given string out into the opened
file, Control-D's, nulls, and all those other things that ProDOS BASIC would
otherwise filter out or choke on.  Plus, bypassing BASIC.SYSTEM altogether
means that writing into the file will be a wee bit faster.

>From BASIC, the call to the assembly routine would look something like this:


        CALL WRFILE, REFNUM, A$
-or-
        CALL WRFILE, REFNUM, "Some text to write to the file" + CHR$(13)

If this is acceptable, I can write the assembly code that will allow you to do
this and post a BASIC program here (which simply will be a few lines of DATA
statements and a FOR-NEXT loop to poke the data into memory).

--Morgan Davis

UUCP: crash!pnet01!pro-sol!mdavis
ARPA: crash!pnet01!pro-sol!mdavis@nosc.mil
INET: mdavis@pro-sol.cts.com