[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "And" question



PureBytes Links

Trading Reference Links

> "EasyLanguage is optimized for speed, and one optimization relates
> to evaluating true/false expressions that include logical
> operators. When an expression is being evaluated and it is
> determined that regardless of the remainder of the expression, the
> first part of the expression is false (or true), the remainder of
> the expression is not evaluated."

Translation into English.....

condition1 = A or B;
If A is true, condition1 is true and there is no need to check B.
If A is false, move on and check B.

condition1 = A and B;
If A is false, condition1 is false and there is no need to check B.
If A is true, move on and check B.

Bottom line, don't sweat it. It works just as you would expect with
multiple and/or statements. Use parentheses to keep EL from getting
confused when your statements get complicated.

condition1 = ((A and B) or (X and Y)) and (J or K);

will have the same end result as

condition2 = A and B;
condition3 = X and Y;
condition4 = condition2 or condition3;
condition5 = J or K;
condition1 = condition4 and condition5;

-- 
  Dennis