LoadStringValue(name, default)Toy Basic does not provide direct access to file system for security reasons, though it allows you to save and load some program settings, like high scores, user names etc. Settings are remembered per EXE file and per program name. If you rename or move your EXE file or rename the program, settings will be lost. Function LoadStringValue should be used to load a previously saved string setting. If the setting was not saved before, it will return the value supplied in second parameter:
program "User Name Demo" ' settings will be lost if you change program name
name = LoadStringValue("user name", "")
if name = ""
name = "user" & int (rnd () * 100000)
SaveStringValue("user name", name)
end if
DrawText(10, 10, "user name: " & name)
See also: