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.
Syntax
Section titled “Syntax”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.
Remarks
Section titled “Remarks”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
CCB1110
Examples
Section titled “Examples”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$.
See also
Section titled “See also”From the Thoroughbred Basic Language Reference, Volume II: F–Q, version 8.9.1. Open this page in the PDF