xHarbour Reference Documentation > Operator Reference xHarbour Developers Network  

.OR.

Logical OR operator (binary).

Syntax

<lCondition1> .OR. <lCondition2>

Arguments

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

Description

The logical .OR. operator yields the result of a logical OR operation with left and right operand. The result is only .T. (true) when the value of one operand is also .T. (true), in all other cases the result is .F. (false).

When multiple .OR. operators appear in an expression, the result is already determined when one operand has the value .T. (true). In this case, remaining .OR. operators are not evaluated for optimization reasons. This so called shortcut optimization can be switched off using the compiler switch /z.

Info

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

Example

// This example shows results of .OR. operations
// using different operands:

   PROCEDURE Main
      ? .T. .OR. .T.                   // result: .T.
      ? .T. .OR. .F.                   // result: .T.
      ? .F. .OR. .T.                   // result: .T.
      ? .F. .OR. .F.                   // result: .F.
   RETURN

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