Or Else Operator

Performs an inclusive logical disjunction with short-circuit evaluation.

Syntax

expression_1 Or Else expression_2

Parts

expression_1
Necessary Boolean expression
expression_2
Necessary Boolean expression

Instructions

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 expression_1 isAnd expression_2 isThe result is
Truenot evaluatedTrue
FalseTrueTrue
FalseFalseFalse

Examples

See also