OR

Contents


or is used to define a “logic or” between two logic values.

 

Syntax

    exp1 or exp2

 

Parameters

Element

Description

Restrictions

exp1

expression_logique.

None.

exp2

expression_logique.

None.

 

Examples

   # Test : is there I=1 or J=2 ?
    If I = 1 or J = 2
           Infbox "One of the two conditions is fulfilled"
    Endif

# Loop as long as I is positive or J is positive
    While I > 0 or J > 0
           I -= 1  :# Decrement I
           J -= 1  :# Decrement J
    Wend

 

Description and comments

or is used to obtain a logic result (0->false, 1->true) dependent on two logic expressions having true (non null) or false (null) values, in accordance with the following truth table:

exp1

exp2

exp1 or exp2

FALSE
FALSE
TRUE
TRUE

FALSE
TRUE
FALSE
TRUE

FALSE (=0)
TRUE(=1)
TRUE (=1)
TRUE (=1)

 

Comment:

When a formula is entered containing an 'or' in a mask or routine, for example, the keyword recognition phase replaces or with the character | (vertical bar) that is its equivalent; therefore you can write both:

·         exp1 or exp2

·         exp1 | exp2

 

Associated errors

Error

Description

ERMODE (10)

The arguments are not numerical.

 

Associated key words

AND - XOR - NOT


CONTENTS


Copyright © Sage 1999 - 2007