Or Else Operator

Performs an inclusive logical disjunction with short-circuit evaluation.

Syntax

expression1 Or Else expression2

Parts

expression1
Required Boolean expression
expression2
Required Boolean expression

Remarks

The result is of type Boolean.

The Or Else operator closely resembles the Or operator, except when the first operand evaluates as true. When this occurs, the second operand is not evaluated at all. This is valid behavior because the truth of the operation can always be proven whenever the first operand is true. This is known as short-circuit evaluation. The following truth table summarizes this behavior.

If expression1 isAnd expression2 isThe result is
Truenot evaluatedTrue
FalseTrueTrue
FalseFalseFalse

Examples

See also