What if....

Peter M. Brigham pmbrig at gmail.com
Tue Jan 29 15:31:33 EST 2013


Well, both "and and "or" expressions are one expression, but you are right that my comment only applies to the "and" operator. The engine is very parsimonious and quits when it has enough info to evaluate the expression. With an expression that is exclusively "ands" the first one that evaluates to false settles the value of the expression as false, and the engine stops there and returns the value. With "or" expressions, all the clauses have to be checked in order to decide the value.

-- Peter

Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig


On Jan 29, 2013, at 3:11 PM, Robert Sneidar wrote:

> I believe if you change that to or, you will throw an error. Or at least you should! Thinking about this, it may be simpler to think of AND comparisons a single expressions and OR comparisons as delimiting multiple expressions. In a SINGLE LOGICAL EXPRESSION evaluation will terminate when a false is encountered. If you think of what comes after OR as a NEW LOGICAL EXPRESSION it all makes perfect sense. To my twisted brain anyway. 
> 
> Bob
> 
> 
> On Jan 29, 2013, at 10:45 AM, Peter M. Brigham wrote:
> 
>> One situation when the order of evaluation is important is if you have conditions that limit the scope of a general handler, eg:
>> 
>> if "field" is in the target and the locktext of the target = true then…
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list