Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!ccu.umanitoba.ca!herald.usask.ca!alberta!ubc-cs!van-bc!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ucbvax!hplabs!hpcc05!hpcc01!drudman From: drudman@hpcc01.HP.COM (Drew Rudman) Newsgroups: comp.sys.apple2 Subject: Re: More BASIC programs Message-ID: <1520036@hpcc01.HP.COM> Date: 27 Jun 91 16:46:34 GMT References: <1991Jun27.003549.3197@clark.edu> Organization: HP Corp Computing & Services Lines: 30 If all you are storing in the file is one string, you can simply open the file and write to the beginning of it. Use the following code: 10 PRINT CHR$(4)"OPEN ";FILE$ 20 PRINT CHR$(4)"WRITE ";FILE$ 30 PRINT USER$ 40 PRINT CHR$(4)"CLOSE ";FILE$ this will store the variable USER$ into the file FILE$. To read back the value, use: 10 PRINT CHR$(4)"OPEN ";FILE$ 20 PRINT CHR$(4)"READ ";FILE$ 30 INPUT USER$ 40 PRINT CHR$(4)"CLOSE ";FILE$ This will read the value out of the file FILE$ and put it into variable USER$. Everytime you use the first procedure with a different value in variable USER$, it will overwtie the previous value in the file, and a subsequent call to the second procedure will retrieve the most recent USER$ that was written out. There is no need to delete the file FILE$ everytime you want to store off a new USER$. [ Call... 9600bps/60meg ][ Drew Rudman ] [ The Charge ][ ] [ Apple ][ IBM ][ Internet: drudman@hpiosa.corp.hp.com ] [ (415) 321-4713 ][ The Charge BBS: Axe Slinger (#1) ]