AW: Best Practices using globals vs. custprops?

Tiemo Hollmann TB toolbook at
Fri Jun 22 07:42:54 EDT 2007

Hi Sarah,
yes, whereever it is possible I try it with parametrized function calls, but
I meant overall needed status informations, where there is no need for
persistency. I think there it is more a matter of "style" not to use
globals. Perhaps I'll switch in these cases to custom properties of
mainstack, because they are often not related to any object.

BTW does anybody know if there is a performance difference if you declare
local variables or not? (beside the "style" question)


-----Ursprüngliche Nachricht-----
Von: use-revolution-bounces at
[mailto:use-revolution-bounces at] Im Auftrag von Sarah
Gesendet: Freitag, 22. Juni 2007 13:17
An: How to use Revolution
Betreff: Re: Best Practices using globals vs. custprops?

> on various sites - and again in this best practice thread - it is
> recommended not to use globals, or at least so less as possible, because
> they can be changed from everywhere and that's hard to debug and no nice
> style. I really don't see any difference between using globals or
> yet. Properties can be changed also "from everywhere" and even if you
> a central handler to change your properties, this handler can be called
> everywhere. What is the best practice for statuses, flags and all these
> global informations, you need at different times and in different
> And if there is a "clean pratice", what is the difference to using

Firstly, you can often reduce the number of globals needed by sending
parameters to handers & functions instead. This makes for much easier
debugging and maintenance.

Secondly, custom properties are persistent - they are saved with the
stack, while globals are not - they are lost when the stack is closed.
Which you use depends on whether you want to be able to store the data
in the stack or not.

use-revolution mailing list
use-revolution at
Please visit this url to subscribe, unsubscribe and manage your subscription

More information about the Use-livecode mailing list