Global Madness

J. Landman Gay jacque at hyperactivesw.com
Tue Mar 22 01:06:28 EST 2005


On 3/21/05 9:58 PM, Howard Bornstein wrote:

> On Tue, 22 Mar 2005 14:15:56 +1200, Glen Boyd <glenb at napier.govt.nz> wrote:
> ?
> 
>>Have you declared this global in all stacks that require access to it?
>>If I recall correctly you need to specify the global in each stack that
>>you wish to use the variable globally in.
> 
> 
> 
> Yes. If you saw my test script I declared it at the beginning of the
> handler and only called it from that handler. 

I thought that's how all variables work. The compiler won't recognize it 
until it sees it the first time. That means that if it isn't declared 
until a handler runs, then it will be empty until that time. If you 
declare the global at the top of the script instead of just inside a 
handler, the compiler may see it sooner -- but I don't think you will 
get a value until a handler puts one in there.

Local variables at the top of scripts should act the same way, I'd think.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com


More information about the use-livecode mailing list