global variables

Sarah Reichelt sarahr at genesearch.com.au
Wed Feb 4 19:27:28 EST 2004


A global works everywhere, but it has to be declared in each place 
where you need to use it. i.e. you must include the line "global 
gMyGlobalVar" in every script that needs access to the global 
gMyGlobalVar. If you declare it in a handler, only that handler sees 
it, but if you declare it outside the handler, all the handlers in that 
script can see it without needing a separate declaration in each 
handler. Even though globals are accessible everywhere, you must tell 
each script or handler that they are globals before you use them, 
otherwise they will just assume you are creating a local variable of 
the same name.

Cheers,
Sarah
sarahr at genesearch.com.au
http://www.troz.net/Rev/

On 5 Feb 2004, at 10:22 am, hershrev wrote:

> Hello, every body .
> What i understood from the rev Docs that a global variable put it one 
> stack works for the whole application without initializing it.
> What is the difference if put out side a handler or inside.
> thanks hershrev
>
> _______________________________________________
> 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