Can I not use constants in revserver scripts ?

Mark Wieder mwieder at ahsoftware.net
Fri Feb 10 16:53:06 EST 2012


Alex Tweedly <alex at ...> writes:

> The dictionary says that if you set a constant in a script but outside 
> any handler, then it can be used in any handler within the script; and 
> that's exactly what it does do ...

Constants have always been second-class citizens in the RR/LC world. You can
have global variables and you can have constants but you can't have global
constants, so constants have a script-local scope. You can't put constants in an
include file because include files aren't supported on anything but server
scripts. Constants have to be strings or decimal numbers. You can't have
aggregate constants unless you're using glx2's preprocessor, so statements like

constant twoPi = 2 * pi

will fail. Long-standing bugs in the QCC about these.

-- 
 Mark Wieder





More information about the use-livecode mailing list