Giff Persistence and State - Owen2k6/GoOS GitHub Wiki
Variables are process-local to the script run, but you can save/load them to/from disk.
varsSave "0:\\vars.txt";
- Writes
key=Base64(UTF-8 value)
per line.
varsLoad "0:\\vars.txt";
- Reads lines, base64-decodes values, and fills the variable table.
-
varClear name
— remove a single variable. -
varsClearAll
— remove all variables.
onLoad {
varsLoad "0:\\app.vars";
if "username" {
message "Welcome back, $username";
}
}
input usernameBox {
x 10; y 40; width 180
onChange { set username = "$input_usernameBox_text"; }
}
button save {
x 10; y 70; width 80; text "Save"
onClick { varsSave "0:\\app.vars"; message "Saved."; }
}