-
Bit masking problem
I am trying to bit mask the first 6 bits of a byte (8 bits) so the binary looks like 00000011 which I think is &3 ( in hex).
It says here that you just use the AND operator and then the hex.
I am using this:
Dim VPCuff1 As Integer = (buffer(2) and &3) * 256 + buffer(3)
buffer() is a byte array (0-15 bytes). I get an error on the: &3 (hex part). When I use something like &HFF00 it doesn't give me an error.
Any thoughts???
Bebandit:wave: :wave: :wave: :blush: :blush: :rolleyes:
-
I don't think &3 is valid... perhaps &H3. ???
-
thanks
That reduces the error!!
Thanks!!
But what does H value stand for?
(How the hex should I know?)))
:D :D :blush:
-
Not sure really, all I know is evertime i convert from C# to VB, I have to change the 0x..... to &H.... so I guessed. It may not even be the correct value you were looking for lol...