it and explicitVar?

Richard Gaskin ambassador at fourthworld.com
Fri Nov 23 10:14:09 EST 2012


Joe Lewis Wilkins wrote:

 > With my poor vision I can see how I've missed "Strict Compilation
 > Mode"; why couldn't they have used "explicitVars"? (sigh!)

There's a Preference setting under "General" with the option to have the 
IDE display either "Description of option" or "Name of LiveCode property".

By default the IDE is set to use the former, though I find it much more 
helpful - especially for learners - to use the actual property nanes 
since it lets use of the IDE also reinforce one's learning of what the 
engine is doing in the IDE.   And, after all, the English-like 
readability of property names in LiveCode makes most of them 
self-evident anyway.

The "Strict Compilation Mode" option in Preferences->Script Editor may 
appear to be an exception to this, since its label doesn't change when 
you change the IDE labeling preference.

But on closer examination, what the IDE does with "Strict Compilation 
Mode" isn't quite the same thing as setting the explicitVars global 
property; IMO it's much more useful:

With explicitVars set to true, all scripts in memory during the session 
must have been written with that relatively-recent addition to the 
language in mind; any exceptions will throw an error, and all such 
scripts will need to be updated to conform to the requirements of 
explicitVars before they can be used at all, even those you didn't write 
like plugins, third-party libraries, or IDE elements.

With "Strict Compilation Mode", the explicitVars property is set only 
temporarily during the brief moment a script is saved to its object, 
effectively limiting its scope to only those scripts you're editing 
yourself.

Personally I find this a much more useful option, since it allows me to 
use it only when I want it, but doesn't stop all work on a project until 
I bring every script into compliance with explicitVars.

I think there are good reasons to use explicitVars and not to use it, 
depending on the nature of the work I'm doing at a given moment.   The 
IDE's implementation, limited in scope as it is, gives us the best of 
both worlds.

--
  Richard Gaskin
  Fourth World
  LiveCode training and consulting: http://www.fourthworld.com
  Webzine for LiveCode developers: http://www.LiveCodeJournal.com
  Follow me on Twitter:  http://twitter.com/FourthWorldSys





More information about the use-livecode mailing list