X | Y | X and Y | X OR Y -------+--------+------------+---------- .T. | .T. | .T. X Y | .T. X .T. | .F. | .F. X Y | .T. X .T. | .NULL. | .NULL. X Y | .T. X .F. | .T. | .F. X | .T. X Y .F. | .F. | .F. X | .F. X Y .F. | .NULL. | .F. X | .NULL. X Y .NULL. | .T. | .NULL. X Y | .T. X Y .NULL. | .F. | .F. X Y | .NULL. X Y .NULL. | .NULL. | .NULL. X Y | .NULL. X YIn the above table lists the result of the expression and where X Y appears below the line it means that operand was evaluated. Note that whenever null is the left operand both operands must be evaluated.
select 0 local laBool[3] laBool[1] = .t. laBool[2] = .f. laBool[3] = .null. ? " X | Y | X and Y | X OR Y" ? "-------+--------+------------+----------" for i = 1 to 3 x = laBool[i] for j = 1 to 3 y = laBool[j] ? x, " | " ?? y, " | " lcRead = "" ?? IsEval( "X" ) and IsEval( "Y" ), lcRead, " | " lcRead = "" ?? IsEval( "X" ) or IsEval( "Y" ), lcRead endfor endfor function IsEval( lcOperand ) lcRead = lcRead + lcOperand + " " return eval( lcOperand )