simple local variable question
chrism at lumin.us
Sat Feb 21 00:51:57 CST 2004
er, or openCard rather...
On Feb 21, 2004, at 12:44 AM, Christopher Mitchell wrote:
> This seems to have helped. Evidently although the script local
> variables are declared outside handlers, the put assignment is not
> evaluated so they must be initialized in the declaration if they need
> initial values. If they were all dynamic values perhaps declaring at
> the top then immediately following with a set of initialization
> assignments in cardOpen.
> Thanks very much.
> On Feb 20, 2004, at 7:21 PM, Dar Scott wrote:
>> On Friday, February 20, 2004, at 05:55 PM, Christopher Mitchell wrote:
>>> --card script begins here
>>> local rotAngle
>>> put 20 into rotAngle
>>> on mouseUp
>>> answer rotAngle
>>> end mouseUp
>> Does this help?
>> --card script begins here
>> local rotAngle = 20
>> on mouseUp
>> answer rotAngle
>> end mouseUp
>> See "About... the structure of a script" in the doc.
>>> My question is, why does this not put up an answer dialog with "20"
>>> in it? the dialog that comes up is empty.
>> Another question might be why doesn't the compiler complain. I have
>> gotten the impression is that this is for some legacy code in which
>> people hide data in scripts for some reason.
>> Dar Scott
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
> use-revolution mailing list
> use-revolution at lists.runrev.com
More information about the use-livecode