OK - same problem. How do I get bb to be 152. Logging bs gives 152 but doing bb = bs and then logging bb still gives -104. I need bb (byte) to be 152....
The below code logs -104 for bb but 152 for bs. I need bb to be 152...
B4X:
Dim bb As Byte = -104
Dim bs As Short = 256 + bb
bb = bs
Log("bbnew + 256 = " & bb)
The byte type can not contain a positive number superior to 127.
They are 8 bits, it first bit is used only for the sign. The other 7 bits are used to represent a number 0 127
The byte type can not contain a positive number superior to 127.
They are 8 bits, it first bit is used only for the sign. The other 7 bits are used to represent a number 0 127
Hmmmm.....that is true. Need to rethink how I am going to solve this. Issue is that there are a number of bytes in the byte() array that are less than 0 and they all yield "0xfffd" and not the hex values that I need.