simple local variable question
Christopher Mitchell
chrism at lumin.us
Sat Feb 21 01:34:44 EST 2004
However, that is contrary to the documentation for the local command:
You create a script local variable by using the local command in a
script, outside any handlers in the script.
(pasted from transcript dictionary)
So I'm still not convinced that it must be in a handler, or if so then
the documentation is misleading.
Yours,
Chris
On Feb 20, 2004, at 7:20 PM, Phil Davis wrote:
> ----- Original Message -----
> From: "Christopher Mitchell" <chrism at lumin.us>
> To: "How to use Revolution" <use-revolution at lists.runrev.com>
> Sent: Friday, February 20, 2004 4:55 PM
> Subject: simple local variable question
>
>
>> Howdy,
>>
>> I'm declaring some local variables at the top of a card script that I
>> need to use in several handlers... here is a simplified recipe
>> question
>> that will help me understand why I'm not able to access the values I'm
>> assigning to them:
>>
>> --card script begins here
>>
>> local rotAngle
>> put 20 into rotAngle
>>
>> on mouseUp
>> answer rotAngle
>> end mouseUp
>>
>> --
>>
>> My question is, why does this not put up an answer dialog with "20" in
>> it? the dialog that comes up is empty.
>
>
> It comes up empty because nothing can ever cause 'rotAngle' to be set.
> Any
> executable code not inside a handler can never be executed.
>
> Phil Davis
>
>
>>
>> Thanks,
>> Chris
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
More information about the use-livecode
mailing list