Here, I've made a simple example. This program asks the user for input, and then writes the value to a file. Next time you open the program, it will show you the variables that was saved to the file last time the program was run. Then you will be able to change the values from within the program, and see how it works. The source is commented.
`First we check if the Highcoref-file exist.
if file exist("C:\Highscores.txt")
`\\\\
`If the file exist, then we open it up, and read the content.
open to read 1,"C:/Highscores.txt"
read string 1, player1$
read string 1,score1$
read string 1,player2$
read string 1,score2$
close file 1`don't forget to close the file after use!
`\\\\
`Then we asign the new values to the two variables(remember the val()-converter?).
score1=val(score1$)`convert strings to numbers, and asign them to "score1" and "score2"
score2=val(score2$)
`\\\\
else
`if the file doesn't exist...
`Declare two new variables with some names.
player1$="Bob"
player2$="James"
`\\\\
`Ask the user for some values, and asign those values to the two "score"-vaiables.
input "Enter a value ", score1
input "Enter another value ",score2
`\\\\
`Now we open the highscores-file, and write the new values.
open to write 1,"C:/Highscores.txt"
write string 1,player1$
write string 1,str$(score1)
write string 1,player2$
write string 1,str$(score2)
close file 1
endif
`\\\\
`Then print the values for the user to examine
print player1$;" scored ";score1
print player2$;" scored ";score2
`\\\\
wait key
`Ask the user whether he wants to change the values.
input "Do you want to change the scores?(y/n)", change$
`\\\\
`If he answers "y", then ask him for new values, and write them into the file.
if lower$(change$)="y"
input "Enter a value ", score1
input "Enter another value ",score2
delete file "C:/Highscores.txt"`We overwrite the old file
open to write 1,"C:/Highscores.txt"
write string 1,player1$
write string 1,str$(score1)
write string 1,player2$
write string 1,str$(score2)
close file 1
endif
`\\\\
I can't be fired... Slaves are SOLD!