The "presevation" variable ?

Mark Schonewille m.schonewille at economy-x-talk.com
Sat Jul 14 05:24:14 EDT 2007


Hi David,

local lVar

on mouseUp
  if lVar is empty then
    put 1 into lVar
  else add 1 to lVar
  put "You clicked" && lVar && "times"
end mouseUp

Click the button once or twice. Now set preserveVariables to false  
and add a comment or even a space to the script. It will start  
counting again when you click on the button.

Set preserveVariables to true and click the button. Edit the script  
and click again. You will see that it continues counting.

Unfortunately, the variable preservation setting in the preferences  
is broken. To use this feature, you have to set the preserveVariables  
manually in the message box at the start of each new session:

set the preserveVariables to true

Let's hope that this problem will get fixed soon.

Best regards,

Mark Schonewille

--

Economy-x-Talk Consulting and Software Engineering
http://economy-x-talk.com
http;//www.salery.com

Quickly extract data from your HyperCard stacks with DIFfersifier.  
http://differsifier.economy-x-talk.com


Op 14-jul-2007, om 10:48 heeft David het volgende geschreven:

> This is a relatively new version feature and is not documented except
> for this:
>
>> If variable preservation is turned on, script locals retain their  
>> values when the script is re-compiled, unless there is an error in  
>> the script. With variable preservation turned off, script locals  
>> lose their values when the script is recompiled.
>
> There was some documentation in the readme files at one time - but I
> cannot find it. Is it an engine / language feature or an IDE feature
> and anyone have an example of use?




More information about the use-livecode mailing list