TGC Codebase Backup



saving program by Slayer93

12th Sep 2004 12:14
Summary

Input something and store it in a file then read that file



Description

Input something and store it in a file
then read that file and I'll show you what they mean



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    `sync to refresh screen
sync on
sync rate 30
`hold file in varible
save$="save2.dba"
`loop
do
`if file do not exist you will make a file 
if file exist(save$)=0
`put something in a file
input "What is your name? ";name$
`make a file
open to write 1,"save2.dba"
`write the name to file
write string 1,name$
`clear screen
cls
endif
`if file open then close it
if file open(1) then close file 1
`open file to read
if file exist(save$)=1
open to read 1,save$
`read string
read string 1,name$
set cursor 0,0
`print the string
print name$
`delete or don't delete 
text 100,100,"do you want to delete your name? enter=Yes escape=no"
if returnkey()=1 then delete file "save2.dba" : text 100,200,"deleted"
if escapekey()=1 then end
endif
sync
loop