How can I strip the hi & low bytes from an integer. I have tried numerous
code examples from the web and I can't get any to work. I have tried:
// Get the low and high order words.
int pintLow = pintValue and &Hffff;
int pintHigh = (pintValue and &Hffff0000) >16 .. doesn't work
Have even tried VB.NET bit converter class, can't get it to give me the
right values..
Public Sub SplitInt2(ByVal Value As Integer, ByRef LoWord As Short,
ByRef HiWord As Short)
Dim buf(3) As Byte
buf = GetBytes(Value)
LoWord = ToInt16(buf, 0)
HiWord = ToInt16(buf, 2)
End Sub
I tried to break the value 1000, it should return a 03 and 232 or 03E8 in
hex.
Any ideas how to break the value into high and low bytes, or am I doing this
wrong..
Thanks...
BUC
code examples from the web and I can't get any to work. I have tried:
// Get the low and high order words.
int pintLow = pintValue and &Hffff;
int pintHigh = (pintValue and &Hffff0000) >16 .. doesn't work
Have even tried VB.NET bit converter class, can't get it to give me the
right values..
Public Sub SplitInt2(ByVal Value As Integer, ByRef LoWord As Short,
ByRef HiWord As Short)
Dim buf(3) As Byte
buf = GetBytes(Value)
LoWord = ToInt16(buf, 0)
HiWord = ToInt16(buf, 2)
End Sub
I tried to break the value 1000, it should return a 03 and 232 or 03E8 in
hex.
Any ideas how to break the value into high and low bytes, or am I doing this
wrong..
Thanks...
BUC
Comment