Explicit Variables

Richard Gaskin ambassador at fourthworld.com
Fri Jan 29 13:34:14 EST 2016


Mark Waddingham wrote:
 > That should work fine. The explicitVars property is only set in
 > the IDE around code which compiles / sets object scripts (i.e.
 > In the script editor). It is false the rest of the time.

Is Kay using explicitVars or the IDE's "Strict Compilation Mode"?

My understanding is that the engine's explicitVars property works as it 
does in SuperCard where it came from, that it's persistent throughout 
the session.

In contrast, Strict Compilation Mode only applies explicitVars 
momentarily for compilation to catch the sorts of things it's good for, 
then turning it off again so it doesn't conflict with any other scripts 
that may be running that don't conform to explicitVars' requirements.

Is my understanding correct, or has the engine implementation of 
explicitVars changed?

 >> On 29 Jan 2016, at 02:45, Kay C Lan wrote:
 >>
 >> Not a discussion about the pros and cons, or a discussion on arrays,
 >> I just need a simple answer.
 >>
 >> put "apple,orange,banana" into tFruit
 >> repeat with x = 1 to the number of items in tFruit
 >>  do "put item x of tFruit into tVar" & x --create a dynamic variable 
name
 >> end repeat
 >> put tVar2
 >>
 >> I assume creating dynamic variable names will not work with
 >> explicitVariables set in the IDE but it will actually work in a
 >> standalone.

As noted above, AFAIK the IDE currently has no means of setting the 
explicitVars global property, at least not in any way that can affect 
things beyond the moment of compilation.  So unless you're turning on 
explicitVars in one of your scripts you should be fine.

Too bad arrays are excluded from this discussion, as they're the perfect 
fit for cases like this where the number or names of variables can't be 
known in advance - simpler to write, faster to run.

-- 
  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