Giff Persistence and State - Owen2k6/GoOS GitHub Wiki

Persistence & State

Variables are process-local to the script run, but you can save/load them to/from disk.

Save all variables

varsSave "0:\\vars.txt";
  • Writes key=Base64(UTF-8 value) per line.

Load variables

varsLoad "0:\\vars.txt";
  • Reads lines, base64-decodes values, and fills the variable table.

Clearing

  • varClear name — remove a single variable.
  • varsClearAll — remove all variables.

Example

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."; }
}
⚠️ **GitHub.com Fallback** ⚠️