xHarbour Reference Documentation > Operator Reference |
Logical AND operator (binary).
<lCondition1> .AND. <lCondition2>
The logical .AND. operator yields the result of a logical AND operation with left and right operand. The result is only .T. (true) when the value of both operands is also .T. (true), in all other cases the result is .F. (false).
When multiple .AND. operators appear in an expression, the result is already determined when one operand has the value .F. (false). In this case, remaining .AND. operators are not evaluated for optimization reasons. This so called shortcut optimization can be switched off using the compiler switch /z.
See also: | & (bitwise AND), .OR., .NOT. |
Category: | Logical operators , Operators |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// This example shows results of .AND. operations // using different operands: PROCEDURE Main ? .T. .AND. .T. // result: .T. ? .T. .AND. .F. // result: .F. ? .F. .AND. .T. // result: .F. ? .F. .AND. .F. // result: .F. RETURN
http://www.xHarbour.com