xHarbour Reference Documentation > Operator Reference xHarbour Developers Network  

.AND.

Logical AND operator (binary).

Syntax

<lCondition1> .AND. <lCondition2>

Arguments

<lCondition>
<lCondition1> and <lCondition2> are logical expressions to AND.

Description

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.

Info

See also:& (bitwise AND), .OR., .NOT.
Category: Logical operators , Operators
LIB:xhb.lib
DLL:xhbdll.dll

Example

// 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

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe