The dictionary entry for constant says:

If you place the constant statement in a handler, you can use the constant anywhere in the handler. If you place the constant statement in a script outside any handler, you can use the constant anywhere in the handlers of that script.
NB - "can use the constant anywhere *in the handlers* of that script".

That was a reasonable limitation in traditional Livecode - but seems less reasonable in the context of revserver. It is (I think) common practice, and it's certainly possible, to have quite a lot of the "top-level" code be in the script itself, perhaps with html intermingled with it, i.e. not be in a handler.

So the obvious, simple code fragment

constant K = 3.14159
put $_POST["diameter"] * K

doesn't give the expected result :-)

Anyone see any reason why constants *shouldn't* be usable outside handlers ?

Thanks
-- Alex.
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to