M
Mars Shi
Hi,
I have some special requirements on bit shift by vb.net.
- I want to know how to get the shifted bit value.
- I want to know how to make shifted bit to another variable.
Suppose, I have two variables, byteA is &H0, byteB is &H8F
For the 1st question, if I left shift byteB, like byteB << 1, byteB will
be 00011110 (&H1E), but I want to get the bit being shifted, which is 1,
please tell me how I could get it.
For the 2nd question, I wish the shifted bit from byteB could be shifted
into byteA. The result I want is that, after operation, byteA would be
&H01, and byteB would be &H1E.
Also I wish variables could be byte, integer or long.
Is there any simple operator from VB.net?
Thanks
Mars
I have some special requirements on bit shift by vb.net.
- I want to know how to get the shifted bit value.
- I want to know how to make shifted bit to another variable.
Suppose, I have two variables, byteA is &H0, byteB is &H8F
For the 1st question, if I left shift byteB, like byteB << 1, byteB will
be 00011110 (&H1E), but I want to get the bit being shifted, which is 1,
please tell me how I could get it.
For the 2nd question, I wish the shifted bit from byteB could be shifted
into byteA. The result I want is that, after operation, byteA would be
&H01, and byteB would be &H1E.
Also I wish variables could be byte, integer or long.
Is there any simple operator from VB.net?
Thanks
Mars