Hex And Bitmasking question
For some strange reason, I get 16 for jack2. I am bitmasking the integer using the hex &HFC (11111100) which would give me the binary 00 which is zero.
<code>
Dim byteit(2) As Byte
Dim jack1 As Integer
Dim jack2 As Integer
Dim jack3 As Integer
byteit(0) = 16
byteit(1) = 32
jack1 = byteit(0) >> 2 ' returns 4 which is correct
jack2 = (byteit(0) And &HFC)
jack3 = jack2 + byteit(1) 'ocuff
TextBox4.Text = jack1 & " " & jack2 & " " & jack3
</code>
returns: 4 16 48
Any thoughts???