Weirdness with global variable declaration

Jeremy Smith helloc66 at hotmail.com
Mon Jan 19 02:08:17 EST 2004


Instead of doing this

on openCard
global debugMode
global inChatUsers, newChatSocket
global chatRect, chatRectHalf, wbRect
put "8,8,596,314" into chatRect
....

do this

global debugMode
global inChatUsers, newChatSocket
global chatRect, chatRectHalf, wbRect
on openCard
put "8,8,596,314" into chatRect
...

Then you can access the globals from all the handlers (opencard/closecard) 
etc...

Cheers.

>From: Doug Lerner <doug at webcrossing.com>
>Reply-To: How to use Revolution <use-revolution at lists.runrev.com>
>To: How to use Revolution <use-revolution at lists.runrev.com>
>Subject: Re: Weirdness with global variable declaration
>Date: Mon, 19 Jan 2004 15:37:22 +0900
>
>What do you mean by "off by themselves"?
>
>doug
>
>On 1/19/04 2:47 PM, "Thomas J McGrath III" <3mcgrath at adelphia.net> wrote:
>
> > just declare the globals off by themselves...
> >
> > then do your on opencard.
> >
> >
> > On Jan 18, 2004, at 11:40 PM, Doug Lerner wrote:
> >
> >> I read about doing that - in a so-called "script" rather than in a
> >> "handler". But I wasn't clear about how that works.
> >>
> >> How do script commands get executed if they are not part of a handler?
> >>
> >> doug
> >>
> >> On 1/19/04 1:32 PM, "Thomas J McGrath III" <3mcgrath at adelphia.net>
> >> wrote:
> >>
> >>> Have you tried creating the global outside of this handler?
> >>> put it by itself before the openCard .
> >>>
> >>> On Jan 18, 2004, at 9:37 PM, Doug Lerner wrote:
> >>>
> >>>> In an openCard handler I have:
> >>>>
> >>>> on openCard
> >>>>   global debugMode
> >>>>   global inChatUsers, newChatSocket
> >>>>   global chatRect, chatRectHalf, wbRect
> >>>>   put "8,8,596,314" into chatRect
> >>>>   .
> >>>>   .
> >>>>   .
> >>>>
> >>>> But a button in that card doesn't seem to know the value of chatRect.
> >>>> And
> >>>> while globalNames lists inChatUsers, newChatSocket and debugMode it
> >>>> doesn't
> >>>> list any of the three globals on the third line of the handler above.
> >>>>
> >>>> Any reasons why a global should no longer be among the globalNames?
> >>>>
> >>>> Thanks,
> >>>>
> >>>> doug
> >>>>
> >>>> _______________________________________________
> >>>> use-revolution mailing list
> >>>> use-revolution at lists.runrev.com
> >>>> http://lists.runrev.com/mailman/listinfo/use-revolution
> >>>>
> >>>>
> >>>
> >>> Macintosh PowerBook G-4 OSX 10.3.1, OS 9.2.2, 1.25 GHz, 512MB RAM, Rev
> >>> 2.1.2
> >>>
> >>>
> >>> Advanced Media Group
> >>> Thomas J McGrath III    € 2003 €    3mcgrath at adelphia.net
> >>> 220 Drake Road, Bethel Park, PA 15102
> >>>
> >>>
> >>>
> >>> _______________________________________________
> >>> 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
> >>
> >>
> >
> > Macintosh PowerBook G-4 OSX 10.3.1, OS 9.2.2, 1.25 GHz, 512MB RAM, Rev
> > 2.1.2
> >
> >
> > Advanced Media Group
> > Thomas J McGrath III    € 2003 €    3mcgrath at adelphia.net
> > 220 Drake Road, Bethel Park, PA 15102
> >
> >
> >
> > _______________________________________________
> > 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

_________________________________________________________________
Send mobile Christmas cards, download a festive ringtone and win a Motorola 
E365. Go to:  http://ninemsn.com.au/mobilecentral/christmas.asp



More information about the use-livecode mailing list