bitOr
bitOr(op: Integer): Integer;
The bitOr method of the Integer primitive type compares each bit in the receiver with the corresponding bit in the op parameter, and returns an integer representing the receiver bits ORed with the argument.
The generated return values are listed in the following table.
Bits in Receiver and Operand | Corresponding Bit in Return Value |
---|---|
One or both bits are 1 | 1 |
Neither bit is 1 | 0 |
The code fragment in the following example shows the use of the bitOr method.
constants BitFlagNone = #00; BitFlag1 = #01; vars int : Integer; begin int := BitFlagNone; // set bit flag 1 int := int.bitOr(BitFlag1); // test that bit flag 1 is set if int.bitAnd(BitFlag1) <> 0 then write "flag 1 is set"; endif; end;