Best Practices using globals vs. custprops?
Scott Kane
scott at cdroo.com
Fri Jun 22 07:00:39 EDT 2007
----- Original Message -----
From: "Tiemo Hollmann TB" <toolbook at kestner.de>
> Ok, what I can follow is the better reference and with that the better
> documentation "to whom an information belongs" with properties instead of
> globals, as far there is a connection between them (not to store the
> number of legs of the cat independ of the cat in a global). So I see an
> advantage
> in style, but not in safty against unwilling change. For statuses and
> flags (user has done something or not / a handler or condition was called,
> or
> not,...) I don't have a relation to any object, so I would prefer globals.
> Can you go with this? Thank you for your thoughts
Well. In this isntance you actually have to options. You could use a
global and have the problems we've talked about - or - you could use a
"Custom Property" (in Revolution speak) which allows us to create a special
property of the object - say a button - to check what the user has done.
This way we never get confused as we might with a global variable.
Scott
More information about the use-livecode
mailing list