Here's the entire program:
REM Project: Trivia
REM Created: 5/15/2009 5:55:08 PM
REM Last Updated 5/15/2009
REM
REM ***** Main Source File *****
REM
if keystate(57) = 1
goto mainmenu
endif
productkey:
cls
print " Enter your product key."
print ""
input productkey$
if productkey$="123098" then goto mainmenu
if productkey$="abilene" then goto mainmenu
goto productkey
mainmenu:
cls
print "****************Main Menu****************"
print ""
print " 1. New game"
print " 2. Load Game"
print " 3. Instructions"
print " 4. Exit Game"
print ""
input "", mainmenu01$
if mainmenu01$="1" then goto name
if mainmenu01$="2" then goto loadgame
if mainmenu01$="3" then end
if mainmenu01$="4" then end
function SaveGame()
if file exist("savegame.txt") then delete file "savegame.txt"
open to write 1,"savegame.txt"
write string 1,name$
write string 1,question$
write float 1,score
close file 1
endfunction
function LoadGame()
open to read 1,"savegame.txt"
read string 1,name$
read string 1,question$
read float 1,score
close file 1
goto easy002
endfunction
name:
cls
print " Enter your name"
input "", name$
goto difficulty
difficulty:
cls
print "Choose your difficulty"
print ""
print " 1.Easy"
print " 2.Hard"
input "", difficulty$
if difficulty$="1" then difficulty0$="Easy"
if difficulty$="1" then goto easy001
goto difficulty
easy001:
question$="easy001"
score#=0
cls
print "", question$
print "", name$
print "", score#
wait key
goto SaveGame
easy002:
cls
print " Easy002"
print "", question$
print "", name$
print "", score#
wait key"
Right now, question 1 and 2 are just test subjects, q1 sets the variables then goes to the SaveGame function...Then I exit the game and check the .txt which is blank...
AMPConcepts.webs.com