Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site vu-vlsi.UUCP Path: utzoo!watmath!clyde!cbosgd!ukma!psuvm.bitnet!psuvax1!vu-vlsi!perry From: perry@vu-vlsi.UUCP (Rick Perry) Newsgroups: net.micro.trs-80 Subject: Re: TRS-80 Model 100 - how to write NUL to files? Message-ID: <265@vu-vlsi.UUCP> Date: Sun, 23-Mar-86 09:36:06 EST Article-I.D.: vu-vlsi.265 Posted: Sun Mar 23 09:36:06 1986 Date-Received: Tue, 25-Mar-86 02:35:14 EST References: <341@mhuxh.UUCP> Organization: Villanova Univ. EE Dept. Lines: 24 Summary: M100 .DO files with NUL's In article <341@mhuxh.UUCP>, rex@mhuxh.UUCP (GODBY) writes: > How can I write a string to a RAM file from Model 100 BASIC > if the string contains NUL (ASCII 00) characters? There are three characters that M100 BASIC doesn't like to write to .DO files: 0 (NUL), 26 (ctrl/z), and 127 (DEL). The only one that really is impossible to get there is ctrl/z, since that is used as the end-of-file marker (if a ctrl/z were to appear in the middle of a .DO file, a certain cold-start would occur eventually as the M100 uses that to determine .DO file size when things are deleted or otherwise moved about in the RAM file system). The only way I know of to get a NUL into a file from BASIC is: write some other character there first, as a place holder. Then close the file and get's its start address from the RAM directory map, and POKE the NUL's in. The question arises though, why do you want those NUL's in there in the first place? If they are going to be read or used by some other program, maybe you could use a different character (like 128). Uploading a file with 7-bit stat setting should should strip the high bit off of a chr(128) and end up sending a null. ...Rick ..{pyrnj,psuvax1}!vu-vlsi!perry