[OT] Why would it be a pain?

Dan Shafer revolutionary.dan at gmail.com
Thu Jun 22 14:32:52 EDT 2006


Clearly Rev and HC work differently with regard to IT.

I'm not sure, Richard, that an example that "gets" a string -- a perfecty
legal but bizarre-seeming use of the "get" command to me -- really
demonstrates globalness or the lack thereof.

Having said that, I elaborated a bit on your example just to see what would
happen.

on mouseUp
  get 23
  putit
end mouseUp

on putit
  put it
end putit

That puts the word "it" into the message box.

But if I change put it so it looks like this:

on putit
  answer it
end putit

the dialog is empty.

So what is it that putit is putting when told to put it? Is it the string
"it" rather than the name of the variable? I'm not even sure how to find
out. Every time I try, I end up in a circularity.


On 6/22/06, Devin Asay <devin_asay at byu.edu> wrote:
>
>
> 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
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dan Shafer, Information Product Consultant and Author
http://www.shafermedia.com
Get my book, "Revolution: Software at the Speed of Thought"
>From http://www.shafermediastore.com/tech_main.html



More information about the use-livecode mailing list