| **Navigation:**  [[introduction.htm|Language Reference]] > 13 - Built-in Functions >====== BOR (return bitwise OR) ====== | [[blank erase graphics .htm|{{btn_prev_n.gif|Previous page}}]][[introduction.htm|{{btn_home_n.gif|Return to chapter overview}}]][[box draw a rectangle .htm|{{btn_next_n.gif|Next page}}]] | | || **BOR(**//value//,//mask//**)** {{blk2blue.jpg|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 return bitwise and .htm|BAND]] [[bxor return bitwise exclusive or .htm|BXOR]] [[bshift return shifted bits .htm|BSHIFT]]