LOTUSSCRIPT LANGUAGE


Or operator
Performs a logical disjunction on two expressions.

Syntax

expr1 Or expr2

Elements

expr1, expr2


Usage

In using the Or operation, both expressions must be FALSE for the result to be FALSE.
expr1expr2Result
TRUE TRUE TRUE
TRUE FALSE TRUE
FALSE TRUE TRUE
FALSE FALSE FALSE
TRUENULLTRUE
NULLTRUETRUE
FALSENULLNULL
NULL FALSENULL
NULL NULLNULL
In addition to performing a logical disjunction, the Or operator compares identically positioned bits in two numeric expressions (known as a bit-wise comparison) and sets the corresponding bit in the result according to the following table.
Bit n in expr1Bit n in expr2 Bit n in result
1 1 1
1 0 1
0 1 1
0 0 0

Example

' Boolean usage

Dim johnIsHere As Boolean, jimIsHere As Boolean

Dim oneOrMoreIsHere As Boolean

johnIsHere = TRUE

jimIsHere = FALSE

oneOrMoreIsHere = johnIsHere Or jimIsHere

Print oneOrMoreIsHere                ' Prints True

' Bit-wise usage
Dim x As Integer, y As Integer
x% = &b11110000
y% = &b11001100
Print Bin$(x% Or y%)                  ' Prints 11111100

See Also