About variable.

Mikey mikeythek at gmail.com
Thu Mar 31 13:44:01 EST 2005


> When would you have to use a global variable, in so far as something
> cannot be accomplished with a custom property?

Obviously you don't have to since you can use custom properties, but
you also don't really need to use custom properties because there are
globals...err...commons (I know, I know, commons in basic were more
restricted, blah, blah, blah).

Anyway, globals are useful in that they only have scope where they are
referenced as global, which is useful in and of itself.  If you
disagree with that assessment then you shouldn't ever be using local
variables, right?  No.  Local variables are nice precisely because of
their scope.  Globals are useful because of their scope.  Custom
properties are useful because of their scope (and because of a lot of
other reasons as well).

Since we can't instantiate our own classes as yet, globals serve a
useful purpose of being able to carry system-wide values that are not
tied to any particular value, and perhaps to any particular stack.

I'm particularly interested in trying to recreate my mail server in RR
just for the heck of it.  In such a system globals are extensively
used since there are properties that will have to span multiple
stacks.
-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."


More information about the use-livecode mailing list