I'm trying to figure out how to get a value in a field in a custom dialog to stick each time the dialog script is run until it is changed. Then when the script is run again the new value is there.
I'm not getting it.
I'm trying to figure out how to get a value in a field in a custom dialog to stick each time the dialog script is run until it is changed. Then when the script is run again the new value is there.
I'm not getting it.
global.radius = 8; // Declare radius to be a global variable
global.setPersistent("radius", true); // Now say it’s persistent across sessions
(some time later...)
console.println("The value of global.radius is" + global.radius);
(and to kill it...)
delete global.radius;
Note that you can only set persistence on booleans, numbers and strings; and there's a very small storage limit.