Script local variables and initialization.
Alex Tweedly
alex at tweedly.net
Thu Dec 23 15:42:57 EST 2004
I think I've discovered something, but if possible I'd like it to be
confirmed (or alternatively, to know that I'm wrong, and then I can go
back to debugging).
I have some script local variables, used in multiple handlers within the
card script. I expected them to be reset at start up, and to retain
their values from then on - but it appears that they are in fact reset
before openCard.
(i.e. I call one of the handlers within the card script from
preOpenStack, that sets an initial value, but that value appears to be
lost. I know it's probably a bad idea to call a card handler from
preOpenStack, and I'll be changing that anyway - but it would be
reassuring to know that this unconfirmed theory is correct.)
The docs are a bit vague
> The value of a script local variable is retained between handlers, but
> is lost when you quit the application, when you close the stack
> (unless its destroyStack property is false), or when the script is
> re-compiled.
which doesn't really mention start-up conditions.
Thanks
-- Alex.
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.296 / Virus Database: 265.6.2 - Release Date: 20/12/2004
More information about the use-livecode
mailing list