OR                                                                           Operator

result = x OR y

Description

OR returns the logical disjunction of two expressions. result is TRUE, if one or both expressions x and y evaluate to TRUE, otherwise, result is FALSE.

OR also does a bitwise comparison of two numeric expressions. Each bit in result is set to 1 if either corresponding bit in x or y is 1, otherwise it is set to 0.

Example

REM OR Example

'OR performs logical and bitwise disjunction

DIM Test1, Test2, Test3, x, y

x = 1

y = 5

Test1 = x > 0 OR y < 10

Test2 = x > 0 OR y > 10

Test3 = x OR y

PRINT "Logical:"

PRINT "  x > 0 OR y < 10 = " & Test1

PRINT "  x > 0 OR y > 10 = " & Test2

PRINT "Bitwise:"

PRINT "  x OR y = " & Test3

Output

Logical:

  x > 0 OR y < 10 = True

  x > 0 OR y > 10 = True

Bitwise:

  x OR y = 5

Related Items

AND, EQV, IMP, NOT, XOR