defining and using globals in an application

Mark Wieder mwieder at ahsoftware.net
Thu Jul 7 02:07:25 EDT 2011


Jacque-

Wednesday, July 6, 2011, 10:24:06 PM, you wrote:

> On 7/6/11 11:22 PM, Slava Paperno wrote:
>>>> It is okay (technically, anyway) to have identically-named global,
>> script local, and handler local variables.
>>
>> You can't have identically named local variable within the scope of the
>> variable,  > but you can have identically named script variables in different
>> scripts and identically named local variables in different handlers within
>> the same script.

> Right. Basically I meant that names can be duplicated anywhere provided
> they are outside of each other's scope. I didn't say it that way very well.

Once again, no, it doesn't work that way. Global variables are *never*
out of scope, so you can *not* have global and local variables with
the same name. Even if the global variable is declared in a different
script, it's still lurking in memory ready to bite you. You can not
compile

global xyzzy

in one script and then try to compile

local xyzzy

in another script.

-- 
-Mark Wieder
 mwieder at ahsoftware.net





More information about the use-livecode mailing list