Variable Scoping

Ken Ray kray at sonsothunder.com
Mon Oct 9 17:12:04 CDT 2006


On 10/9/06 4:09 PM, "David Bovill" <david at openpartnership.net> wrote:

>> This I can use to mimic a kind of "global" variable system without
>> having to scour the 450,000+ lines of code for variable names and
>> then declare all of them as global at the head of every script that
>> uses them.
> 
> 
> You can put a global declaration outside of a handler - that is at the top
> of any script. So it does not need to be in every handler:

But I'm sure that's what Bob's trying to avoid - even at its best you'd have
to find all the places where the variable's being used and add the global
declaration at the top of that object's script.

If environment variables work for him, then it works for him... I've had
unique situations which seemed illogical to everyone else but me, and
especially when converting from one dev environment to another...

Are there any downsides to using custom environment variables?

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com




More information about the use-livecode mailing list