Function Reference


BitOR

Performs a bitwise OR operation.

BitOR ( value1, value2 [, value n] )

Parameters

value1 The first number.
value2 The second number.
value n [optional] The nth number - up to 255 values can be specified.

Return Value

Returns the two parameters bitwise-OR'ed together.
Bit operations are performed as 32-bit integers.

Remarks

Remember hex notation can be used for numbers.
BitOR() returns 0 in each bit position where all input arguments have a 0 in the corresponding position and 1 wherever there is at least one 1-bit.

Related

BitAND, BitNOT, BitRotate, BitShift, BitXOR, Hex

Example

#include <MsgBoxConstants.au3>

Example()

Func Example()
        ; Note: "b" is the symbol for byte.

        ; Assign a Local variable the bitwise OR operation of 1 and 0.
        Local $iBitOR1 = BitOR(1, 0) ; 0001b OR 0000b = 0001b

        ; Display the result.
        MsgBox($MB_SYSTEMMODAL, "", $iBitOR1)

        ; Assign a Local variable the bitwise OR operation of 1 and 1.
        Local $iBitOR2 = BitOR(1, 1) ; 0001b OR 0001b = 0001b

        ; Display the result.
        MsgBox($MB_SYSTEMMODAL, "", $iBitOR2)

        ; Assign a Local variable the bitwise OR operation of 13 (1101b) and 7 (0111b).
        Local $iBitOR3 = BitOR(13, 7) ; 1101b OR 0111b = 1111b

        ; Display the result.
        MsgBox($MB_SYSTEMMODAL, "", $iBitOR3)

        ; Assign a Local variable the bitwise OR operation of 2 (0010b), 3 (0011b) and 6 (0110b).
        Local $iBitOR4 = BitOR(2, 3, 6) ; 0010b OR 0011b OR 0110b = 0111b

        ; Display the result.
        MsgBox($MB_SYSTEMMODAL, "", $iBitOR4)
EndFunc   ;==>Example