global variables vs. custom properties

J. Landman Gay jacque at hyperactivesw.com
Fri Jan 16 12:49:48 EST 2009


Bob Sneidar wrote:

> Another thing that I like to use properties for is survival through 
> compiles. Script Local variables get wiped on compiles so if you have 
> script local environment variables that get initialized to some value 
> that the operation of your app depends upon, and you edit and compile 
> the script, your app breaks and you have to reinitialize everything. A 
> fix for that is to save your critical environment data to properties at 
> the end of your critical processes, and then check for the state of a 
> script local variable before executing any critical process. If the 
> Script Local variable is not what it ought to be, then you run a resume 
> function that reads the properties back into your variables so your app 
> is in the state it was before compiling.
> 
> A bit tedious I agree. Wouldn't it be nice if someone could write a 
> plugin that did it for you? I would pay good money for that! <cough glx2 
> cough>

No need. Turn on "variable preservation" in the Script pane of your 
Preferences. All done. :)

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the Use-livecode mailing list