[OT] Why would it be a pain?

Devin Asay devin_asay at byu.edu
Thu Jun 22 13:33:46 EDT 2006


On Jun 22, 2006, at 11:24 AM, Richard Gaskin wrote:

> HyperChris wrote:
>
>> My beef with IT is that IT isn't defined as a global variable by  
>> default. For example, if you need a quick file path and type ...
>>     answer file ""
>> ... you can't get your path unless you previously did this ...
>>     global it
>> In HC that was done by default which I found to be very handy. And  
>> that is all I have to say about IT.
>
> I'm not sure "it" is global in HC, at least not in any normal sense  
> of what global usually means.
>
> I just made two buttons on my HC Home stack -
>
> -- Button 1:
> on mouseUp
>  get "hello world"
> end mouseUp
>
> -- Button 2:
> on mouseUp
>   put it
> end mouseUp
>
> When I click Button 1 and then click Button 2, the Message Box  
> contains "it", not "hello world" as we would expect if "it" were  
> global.
>
> If I add global declarations for "it" in both handlers, it does  
> work as expected, but then I believe the same is true for Rev.

If I recall correctly, "it" was sort of a "message box local"  
variable. You could do things like this in the msg box:

   answer "test" <return>

   put it <return>

The contents of "it" would appear in the msg box. It doesn't work  
like this in Rev; you have to go to the multiline message box.

devin


Devin Asay
Humanities Technology and Research Support Center
Brigham Young University




More information about the use-livecode mailing list