param_persistent()

Global parameters whose names start with an underscore (_) can be made persistent.

This function takes a parameter name and an bool flag indicating whether to add or remove the parameter from the persistent storage.

If the parameter name does not start with an underscore or is empty, the function returns `None` (indicating it is not persistent).

Syntax

param_persistent(name, flag)

Parameters

Parameter Type Description
name String The name of the parameter to modify (must start with `_`).
flag Number `1` to mark as persistent, `0` to remove from persistence.

Return Value

Examples

Mark “_speed” as persistent

param_persistent("_speed", 1);  

Remove “_speed” from persistent storage

param_persistent("_speed", 0);

Attempting to mark a non-underscore parameter as persistent fails

param_persistent("speed", 1);  // returns None (invalid)

See also

param_get
param_set
param_remove
param_persistent