Are you talking about writing to a text file? That's pretty simple here's a code snippet with comments
`Lets say the level number is determined by the variable level
Level = 1
`Now we want to save that to a file
`Lets say the file is named "setup.ini" (initialization file)
`We're also going to assume that the setup.ini file is in the same directory as the executable
`Well lets find the file
if file exist("setup.ini") = 1
delete file "setup.ini" `delete it because opening to write makes a new file.
endif
open to write 1, "setup.ini" `File number and file name
write string 1, str$(level) `write a string to the file, I always use strings because they tend to be more accurate for me. The str$() command converts any integer or float value into a string.
`Close the file
close file 1
There you have it. If you have any questions ask me.