Globals

Peter Haworth pete at lcsql.com
Sat Jun 9 22:32:35 EDT 2012


I thought I had global and local definitions figured out but just came
across another gotcha (I think).

It seems that globals are global to any main stack currently in memory.  If
I have global gXYZ defined in stack file A, then open stack file B which
also has a global defined for gXYZ, whatever is done to gXYZ within stack
file A will affect its contents in Stack file B and vice versa.  Do I have
that right?

Assuming I do, I guess that came as a surprise to me for some reason.  I
would not have expected globals to cross stack file boundaries but I guess
they are truly global!

Not a huge deal now that I know about it, just have to be careful when
naming globals that I want to be local (?) to a stack file.

Pete
lcSQL Software <http://www.lcsql.com>



More information about the use-livecode mailing list