Replicating constant behavior at global level has been discussed quite a lot in the past, and not only on this list, but... it is a lot more complicated than it seems at first glance. So, for now at least, there is no way to make a global behave like a constant through declaration. It is up to you to designate some globals as global constants, like using a different prefix than for global variables.

But the problem there is where do you actually set them? Obviously you have to make sure they are set before another stack/card/control uses them.

That's why I decided that a Constant Library was a better way to go.

All the Best
Dave

Well, yes, that is exactly one of the problems. Another, for example, what happens if you make a mistake in assigning a value and need to change it?

So, yes, your Constant Library using functions is one of the reasonable solutions. Making your own classes of globals is another. One can also have a global array to hold your constants, like myConstants["pi"]. Initializing these in your own project is best done in openstack or preopenstack of the mainstack. However, in your big reusable system, that would not work, so for you the Constant Library is probably an optimal solution.

Robert
_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to