Operator .AND. Foundation

.AND. Operator (binary): logical AND

<lCondition1> .AND. <lCondition2>
<lCondition1> and <lCondition2> can be each any expression that returns a logical value.

The .AND. operator links logical expressions and returns the result of a logical AND operation. This returns the value .T. (true) only when all .AND. linked expressions individually evaluate to the value .T. (true).

Many logical expressions can be linked with the .AND. operator. When one or more .AND. operators are used in a program line, the Xbase++ compiler usesshortcut optimizing by default. As soon as a single expression returns the value .F. (false), the result of the entire logical expression has been determined. Any remaining expressions are not evaluated and the result is the value .F. (false).

The shortcut optimizing can be turned off by the compiler switch /Z. If turned off, all expressions linked with .AND. are evaluated in a program line before the execution of the program continues.

The .AND. operator
// This example demonstrates use and results of the 
// .AND. operator 


   ? .T. .AND. .T.                // result: .T. 
   ? .T. .AND. .F.                // result: .F. 
   ? .F. .AND. .T.                // result: .F. (Shortcut optimized) 
   ? .F. .AND. .F.                // result: .F. (Shortcut optimized) 

   ? IIf( 5<10 .AND. 5>1,"True","False") 
                                  // result: True 

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.