Operator .OR. Foundation

.OR. operator (binary): logical OR

Syntax
<lCondition1> .OR. <lCondition2>
Parameters
<lCondition>
<lCondition1> and <lCondition2> can each be any expression which returns a logical value.
Description

The .OR. operator links logical expressions and returns the result of a logical OR operation. This returns the value .T. (true) only when one or more of the .OR. connected expressions result in the value .T. (true).

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

Shortcut optimizing can be turned off by the compiler switch /Z. When it is turned off, all expressions linked with .OR. in a program line are evaluated before the execution of the program continues.

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

PROCEDURE Main 

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

   ? IIf( 5<10 .OR. 10<5,"True","False") 
                                  // result: True 
RETURN 
Feedback

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.