simple local variable question

Christopher Mitchell chrism at lumin.us
Sat Feb 21 01:51:57 EST 2004


er, or openCard rather...


On Feb 21, 2004, at 12:44 AM, Christopher Mitchell wrote:

> Dar,
>
> 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.
>
> Yours,
> Chris
> 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
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>
>
> _______________________________________________
> 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