I have a byte array, msg() and I want to check that specific bytes are specific values, like
The problem is that when the byte value is greater than 127, the byte value is converted to a negative 32 bit number.
For instance, if the byte is 0x8F, it is converted to 0xFFFFFF8F and of course the comparison fails.
There are a number of ugly ways I can think to fix this but really how can I force a byte value to return a 0-255 value?
B4X:
If msg(0) = 0x10 and msg(1) = 0x8F then
For instance, if the byte is 0x8F, it is converted to 0xFFFFFF8F and of course the comparison fails.
There are a number of ugly ways I can think to fix this but really how can I force a byte value to return a 0-255 value?