Or

or performs a logical 'or' between two boolean values.

Syntax

 EXP_NUM1 or EXP_NUM2EXP_NUM1 | EXP_NUM2

Examples

CODECODE CODE # Test : does I=1 or J=2 ?If I = 1 or J = 2CONDITION_RESULT="the condition is true"ElseCONDITION_RESULT="the condition is false"Endif# Loop as long as integers I or J are non-null, avoiding an infinite loop.If I < 0 or J < 0ReturnElseWhile I and JI -= 1 : J -= 1:# Decrement I and JWendEndif

Description and comments

or returns a boolean result that is 0 or 1, 0 being the value false and 1 to value true.
The result depends on the value of the following table:

Value of EXP_NUM1Value of EXP_NUM2Value of (EXP_NUM1 or EXP_NUM2)
false (0)false (0)0 (false).
false (0)true (not equal to 0)1 (true).
true (not equal to 0)false (0)1 (true).
true (not equal to 0)true (not equal to 0)1 (true).

Comments:

 # Returns 1 if a not zero default value is given, otherwise evaluate a formula to verify a not zero valueFunprog GET_VALUE(MY_FORMULA,DEFAULT_VALUE)Value Char MY_FORMULA()Value Integer DEFAULT_VALUEIf DEFAULT_VALUE<>0 or evalue(MY_FORMULA)))<>0End 1EndifEnd 0

Associated errors

ErrorDescription
10Arguments are not numeric.

See also

and, xor, not.