X | Y | X and Y | X OR Y -------+--------+------------+---------- .T. | .NULL. | | .T. X .F. | .NULL. | .F. X |In both these two cases only the left operand is accessed.
x = .null. y = .null. z = .t. w = .null. lcRead = "" ? IsEval( "X" ) or IsEval( "Y" ) or IsEval( "Z" ) or IsEval( "W" ), lcRead lcRead = "" z = .f. ? IsEval( "X" ) and IsEval( "Y" ) and IsEval( "Z" ) and IsEval( "W" ), lcRead function IsEval( lcOperand ) lcRead = lcRead + lcOperand + " " return eval( lcOperand )The result is:
.T. X Y Z .F. X Y ZIn both cases W is not evaluated. In the first case X Y and Z must be evaluated and since Z is true and the next operator is OR the access of W is optimized away. Likewise for the AND case since Z is false the access of W is eliminated.