|Navigation: Language Reference > 10 - Expressions > Types of Expressions >====== Logical Expressions ======|
Logical expressions evaluate true-false conditions in IF, LOOP UNTIL, and LOOP WHILE control structures. Control is determined by the final result (true or false) of the expression. Logical expressions are evaluated from left to right. The right operand of an AND, OR, or XOR logical expression will only be evaluated if it could affect the result. Parentheses should be used to eliminate ambiguous evaluation and to control evaluation precedence. The level or precedence for the logical operators is as follows:
|Level 1||Conditional operators|
|Level 2||~, NOT|
|Level 4||OR, XOR|
LOOP UNTIL KEYBOARD() !True when user presses any key
IF A = B THEN RETURN. !RETURN if A is equal to B
LOOP WHILE ~ Done# !Loop while false (Done# = 0)
IF A >= B OR (C > B AND E = D) THEN RETURN.
!True if a >= b, also true if
!both c > b and e = d.
!The second part of the expression
!(after OR) is evaluated only if the
!first part is not true.