Difference between revisions of "Logical Operators"
From Recital Documentation Wiki
Yvonnemilne (Talk | contribs) |
Yvonnemilne (Talk | contribs) |
||
(One intermediate revision by one user not shown) | |||
Line 5: | Line 5: | ||
!Operator||Operation | !Operator||Operation | ||
|- | |- | ||
− | |.AND.||Logical AND | + | |.AND. / AND||Logical AND |
|- | |- | ||
− | | | + | |.OR. / OR||Logical OR |
|- | |- | ||
− | |. | + | |.NOT./ NOT||Logical NOT |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
|- | |- | ||
|!||Logical NOT | |!||Logical NOT | ||
|- | |- | ||
− | |.XOR. | + | |.XOR. / XOR||Logical Exclusive OR |
− | + | ||
− | + | ||
|- | |- | ||
|} | |} | ||
Line 35: | Line 29: | ||
# Statements enclosed in parentheses | # Statements enclosed in parentheses | ||
− | # | + | # NOT,! |
− | # | + | # AND |
− | # | + | # OR, XOR |
Latest revision as of 14:31, 24 March 2009
The Recital/4GL supports the following Logical Operators:
Operator | Operation |
---|---|
.AND. / AND | Logical AND |
.OR. / OR | Logical OR |
.NOT./ NOT | Logical NOT |
! | Logical NOT |
.XOR. / XOR | Logical Exclusive OR |
If SET OPTLOG or the environment variable DB_OPTLOG are enabled, statements containing Logical Operators are automatically optimized in the following way:
If the Left Hand Side (LHS) of an AND statement is false, then the Right Hand Side (RHS) is parsed, but not evaluated.
If the LHS of an OR statement is TRUE, then the RHS is parsed, but not evaluated.
The above optimizations can be disabled, causing all entries with the statement to be evaluated, if DB_OPTLOG and SET OPTLOG are disabled.
The Logical Operators are evaluated from left to right in the following order:
- Statements enclosed in parentheses
- NOT,!
- AND
- OR, XOR
Example
? .T. and .F. or .T. .T.