Skip to content

IOR

Binary Inclusive OR

This string function conducts a logical OR operation, bit for bit, on two string values of equal length and returns the resulting value.

IOR (string-value1, string-value2 [,ERR=line-ref|,ERC=error-code])
string-value1,2
are strings.
line-ref
is the program line number or label to branch to if an error is produced by this function.
error-code
is a programmer-defined error code. Valid values are positive or negative whole numbers.

If string-value1 is not the same length as string-value2, an ERR=17 results.

The logical OR operation is a bit-by-bit comparison of corresponding bits on both strings. If either (or both) bits being compared are 1, the resultant bit is a 1. If both bits are 0, the resultant bit is 0. For example:

1100 1010

CCB

1110

IOR ("A", "B")

returns the character “C” (01000011) which represents the result of the logical OR of “A” (01000001) and “B” (01000010).

IOR ("B", D$)

if D$=“A”, returns the same result as the first example.

LET X$ = IOR ("A", $60$)

returns the character “a” (01100001) which represents the result of the logical OR of “A” and $60$ (01100000) and assigns it to X$.

AND and XOR functions

From the Thoroughbred Basic Language Reference, Volume II: F–Q, version 8.9.1. Open this page in the PDF