jbv wrote:Yes, it's true - quoted from Scott Raney on the MC list; conditional evaluation ceases as soon as the result can be determined.Rev would drop the evaluation as soon as a false is encountered, hence speeding up the execution of the script...
Is that true, or did I dream ?
It's also documented:
Note: Transcript uses what is known as "short-circuit evaluation" for logical operators. This means that value1 is evaluated first. If value1 is false, the expression value1 and value2 is false regardless of what value2 is (because the expression evaluates to false unless both the values are true). In this case, Revolution does not evaluate value2, since doing so is not necessary to determine the value of value1 and value2. For example, evaluating the expression asin(2) normally causes an execution error (because 2 is not a legal argument for the arc sine function), but evaluating the expression (1 = 0) and (asin(2) = 1) does not cause an error: since (1 = 1) is always false, the whole statement is always false and Revolution never tries to evaluate the asin function.
(This is under "and" and "or", and probably at least the first part should be included in "if" as well.)
I don't know whether his statement covered switch condition evaluation or not - I would expect it does, but would verify that by testing before depending on it.
It's done any time an expression with a binary boolean operator is encountered, regardless of context. So it works in a switch or if or anywhere else, e.g.:
put (1 = 0) and (asin(2) = 1) into foo
puts false into foo without running the faulty asin. -- jeanne a. e. devoto ~ [EMAIL PROTECTED] http://www.jaedworks.com _______________________________________________ use-revolution mailing list [email protected] http://lists.runrev.com/mailman/listinfo/use-revolution
