cross-stack globals, also, file inclusion

Dar Scott dsc at swcp.com
Wed Oct 22 18:24:53 EDT 2003


On Wednesday, October 22, 2003, at 09:23 AM, Alex Rice wrote:

> Like global, it would be usable in all scripts.
> Unlike global, it would not have to be declared in each handler using 
> it.
> Like constant, it would be directly usable in any handler that wants 
> it.

Would each script that uses it, but not define it, have a line in the 
script like this?

    global constant ageOfUniverse

And then the script for the mainstack have something like this?

    global constant ageOfUniverse = "1"


I wonder if this would work as well:

global ageOfUnivere
on startup
    put 1+0 into ageOfUniverse
    ...
end startup

BTW, the Transcript Dictionary entry for 'global' is a little confusing 
and you have to scroll down to get the full picture.  It says it "must 
appear in each handler" that uses it and then later says you "can also 
place a global command in a script, but outside any handlers."

Dar Scott




More information about the Use-livecode mailing list