Back

SaveBoolean

JS Py
Hello World

Save a boolean value to remember varibale values between multiple app starts.

app.SaveBoolean( name, value, file? )

See also: LoadBoolean.

Example - Detect First Start

var file = "demofile";

function OnStart()
{
    var first = app.LoadBoolean( "first", true, file );

    if(first)
        app.ShowPopup( "You ran this demo for the first time!" );
    else
        app.ShowPopup( "This is not the first time you have run this demo." );

    app.SaveBoolean( "first", false, file );
}
from native import app

file = "demofile"

def OnStart():
    first = app.LoadBoolean( "first", True, file )

    if first:
        app.ShowPopup( "You ran this demo for the first time!" )
    else:
        app.ShowPopup( "This is not the first time you have run this demo." )

    app.SaveBoolean( "first", False, file )
    Copy     Copy All       Run      
Boolean
String
String: path to file ( “/absolute/...” or “relative/...” )