Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!uunet!ogicse!clark!pro-hindugods.cts.com!apollo From: apollo@pro-hindugods.cts.com (System Administrator) Newsgroups: comp.sys.apple2 Subject: More BASIC programs Message-ID: <1991Jun27.003549.3197@clark.edu> Date: 26 Jun 91 23:43:20 GMT Sender: usenet@clark.edu Organization: Proline network. Lines: 38 I have another BASIC problem I need help with. I'd also like to thank the two who helped me out with my VAL problem. It works just great now. Thanks guys. Ok, now this problem. What I need to do is have my program remove the present contents of a text file, which is only one line and contains very few characters, then replace that line with a new string of charaters. Like this: 10 REM Another BASIC problem 20 TS$ = "/hd.1/test" 30 PRINT D$"DELETE "TS$:REM That deletes the file just fine...now... 40 PRINT D$"OPEN "TS$:PRINT D$"APPEND "TS$:PRINT TEXT$:PRINT D$"CLOSE "TS$ What that gives me is a syntax error. I realise this much...there is no longer a file "hd.1/test" after it is deleted and the program cannot open a file that does not exist. So, my question...how do I recreate the file...or better yet, how do I delete ONLY the first line of the file "test?" This is what TEST has: user.m Now, I want the program to open TEST, remove that ONE line, and then add the new one stored in variable TEXT$. How do I do that is my question, or do I just have to delete the whole file, and then recreate it? Either way, I can get along. Just help me get the easiest possible way. Thanks guys. Amrit ===The Hindu Love Gods BBS - - - - Bloomfield Hills, MI - - - -313/644-0481=== ProLine: apollo@pro-hindugods | Amrit S. Chauhan Internet: apollo@pro-hindugods.cts.com | Voice: 313/644-2971 UUCP: crash!pro-hindugods!apollo | Intel 9600ex Modem in use. ARPA: crash!pro-hindugods!apollo@nosc.mil | PPE member: thanks jwolverton ------------------------------------------------------------------------------- The only ProLine site in the 313 area. Come on, someone buy a ProLine here. :) :-) C:# %-| =|:-)= :<)= `-) :-C :-O :-D B-) 8-:) :-> :-c :*) ===============================================================================