Globals

Bob Sneidar bobs at twft.com
Mon Jun 11 12:54:15 EDT 2012


It occurs to me that there is room for something like a stack global and card global, where any script belonging to a stack or card would have access to those globals. This would address, in some basic fashion, namespaces if the stack were structured accordingly. Vet this if you please, and if it seems like a good idea I will submit it as an enhancement request. 

Bob


On Jun 9, 2012, at 7:32 PM, Peter Haworth wrote:

> 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>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list