User Tools

Site Tools


bor_return_bitwise_or_.htm
Navigation:  Language Reference > 13 - Built-in Functions >====== BOR (return bitwise OR) ====== Previous pageReturn to chapter overviewNext page

BOR(value,mask)

blk2blue.jpg

BOR Performs bitwise OR operation.
Value A numeric constant, variable, or expression for the bit value to be compared to the bit mask. The value is converted to a LONG data type prior to the operation, if necessary.
Mask A numeric constant, variable, or expression for the bit mask. The mask is converted to a LONG data type prior to the operation, if necessary.

The BOR procedure compares the value to the mask, performing a Boolean OR operation on each bit. The return value is a LONG integer with a one (1) in the bit positions where the value, or the mask, or both, contain a one (1), and zeroes in all other bit positions.

BOR is usually used to unconditionally turn on (set to one), an individual bit, or multiple bits, within a variable.

Return Data Type: LONG

Example:

!BOR(0110b,0010b) returns 0110b  !0110b = 6, 0010b = 2

RateType  BYTE                   !Type of rate

Female    EQUATE(0001b)          !Female mask

Male      EQUATE(0010b)          !Male mask

Over25    EQUATE(0100b)          !Over age 25 mask

CODE

RateType = BOR(RateType,Over25) !Turn on over 25 bit

RateType = BOR(RateType,Male)   !Set rate to male

See Also:

BAND

BXOR

BSHIFT

bor_return_bitwise_or_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1