[OT] Why would it be a pain?

Richard Gaskin ambassador at fourthworld.com
Thu Jun 22 13:24:42 EDT 2006


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.

--
  Richard Gaskin
  Managing Editor, revJournal
  _______________________________________________________
  Rev tips, tutorials and more: http://www.revJournal.com



More information about the use-livecode mailing list