msgbox("Bit masked buttons", vbCritical + vbYesNo + vbSystemModal)
Sub test()
Debug.Print IsOdd(0)
Debug.Print IsOdd(1)
Debug.Print IsOdd(2)
Debug.Print IsOdd(-3)
Debug.Print IsOdd(-10)
Debug.Print IsOdd(32765)
Debug.Print IsOdd(-32768)
End Sub
Function IsOdd(ByVal intValue As Integer) As Boolean
If (intValue And 1) = 1 Then IsOdd = True
End Function
Decimal Binary (Integer)
intValue xxxx xxxx xxxx xxxx
AND
1 0000 0000 0000 0001
=
0000 0000 0000 000?
Decimal Binary (Integer)
0 0000 0000 0000 0000
1 0000 0000 0000 0001