See Also: AND operator, OR operator, IAND operator, Hi function, Low function
Performs a bitwise OR on two integral values.
( {value1} IOR {value2} )
where {value1} and {value2} may be either expressions, variables or constants of either integral type, Char / UChar / Short / UShort / Integer / UInteger / BigInt / UBigInt.
When two values are connected with an encompassing expression by IOR, the encompassing expression evaluates as the value of a binary number derived from the other two values as 1 in positions where either value is 1, and 0 in positions where both values are 0.
move (iMode IOR 1) to iAltMode
In this example, the binary form of the value of iAltMode is set to the value of iMode with its last bit set to 1, regardless of whether the last bit of the binary form of iMode is 1 or 0.
Multiple IORs may be used to link more than two values into a single expression that evaluates as the bitwise or of all the values in the expression:
repeat
// some code in loop
until (iTop IOR iMiddle IOR iBottom)
In this example, the block of commands controlled by until is executed until no position in the binary form of the values of the variables iTop, iMiddle and iBottom contains 1.
There is no symbolic substitute for the word IOR.
When iands, IORs and other arithmetic operators are intermingled in a single expression without grouping parentheses, evaluation proceeds from left to right with each operator connecting the next expression with the result of all previous (left-lying) ones.
(1 iand 2 IOR 3 iand 4)
would evaluate as 0, while
(1 IOR 2 iand 3 IOR 4)
would evaluate as 7.