explicitvariables
Richard Gaskin
ambassador at fourthworld.com
Tue Feb 3 16:03:01 EST 2015
Jean-Jacques Wagner wrote:
> What to do when the compiler does not accept new variable
> (explicitvariables?, so it is well set to false). Your done,
> your script is not working anymore. it disappear and come again.
Short answer:
Don't use the explicitVariables global property; use the "Strict
Compilation Mode" option in Preferences instead.
TL/DR answer:
The explicitVariables global property was originally added to MetaCard
for SuperCard compatibility, but neither community used it universally
which gave rise to a problem:
If any code in the message path doesn't conform to the requirements of
explicitVars, that script won't load and an error will be thrown.
After looking at this problem in depth, the folks at RunRev came up with
a very clever solution that provides the strictness some prefer with
explicitVars but also lets them use any other code that doesn't conform:
When you set the "Strict Compilation Mode" option to true in
Preferences, explicitVariables is set to true, but only momentarily
during compilation. This allows the engine to detect any issues with
non-conformance to explicitVars, but also allows any other script to be
non-conformant without error.
So now you can write as you like to write, the authors of any libraries
you use can write as they like to write, and all the code will play
nicely together.
--
Richard Gaskin
Fourth World Systems
Software Design and Development for the Desktop, Mobile, and the Web
____________________________________________________________________
Ambassador at FourthWorld.com http://www.FourthWorld.com
More information about the use-livecode
mailing list