Script local variables

Thierry Douez th.douez at gmail.com
Sat Feb 22 12:54:08 EST 2014


2014-02-22 17:04 GMT+01:00 Earthednet-wp <prothero at earthednet.org>:
> Mats' posting on encryption difficulties got me thinking about local variables. Are they supposed to persist after the script is done executing, so that the next time a handler within that script is called, they can be expected to hold previously set values? I notice that they don't. Or would this be a task for custom properties?

Hi,

Create a simple stack, a field and a button with this script:

on mouseUp
   testlocal
   testlocal2
end mouseUp

on testlocal
   local x1
   add 1 to x1
   put "x1: " & x1 &cr after fld 1
end testlocal

local x2

on testlocal2
   add 1 to x2
   put "x2: " & x2 &cr after fld 1
end testlocal2


This should clarify your concern...

Regards,

Thierry

------------------------------------------------
Thierry Douez - http://sunny-tdz.com
Maker of sunnYperl - sunnYmidi - sunnYmage - sunnYpdf




More information about the use-livecode mailing list