Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ucbvax!pro-sol.cts.COM!mdavis From: mdavis@pro-sol.cts.COM (Morgan Davis) Newsgroups: comp.sys.apple Subject: Writing ^D into a file Message-ID: <8801090016.AA14351@crash.cts.com> Date: 8 Jan 88 22:55:37 GMT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: pnet01!pro-sol!mdavis@nosc.MIL Distribution: world Organization: The ARPA Internet Lines: 26 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