My goal here is to write the value (integer) of highscore to a file, so that it may be loaded the next time my program is executed. My code seems like it should work; it creates a file if it does not already exist, but nomatter what was in highscore, it reads a 1 from the file. Any ideas?
Thanks in advance.
Quote: "
`Scores/Files
if FILE EXIST("highscore.dat")
OPEN TO READ 1,"highscore.dat"
READ LONG 1,highscore
CLOSE FILE 1
else
MAKE FILE "highscore.dat"
OPEN TO WRITE 1,"highscore.dat"
WRITE LONG 1,highscore
CLOSE FILE 1
...
...
...
if score>highscore
highscore=score
DELETE FILE "highscore.dat"
MAKE FILE "highscore.dat"
OPEN TO WRITE 1,"highscore.dat"
WRITE LONG 1,highscore
CLOSE FILE 1
set cursor 0,10
set text size 100
print "SCORE=",score
print "NEW HIGH SCORE!"
set cursor 0,220
print "G A M E O V E R"
endif
"
http://timmayj.cjb.net/