arenaluigi Well-Known Member Licensed User Longtime User Oct 16, 2012 #1 Hi, if i write: B4X: Dim bytes As Byte bytes=290 not receive any error? Max value Byte is 127 ?
Erel B4X founder Staff member Licensed User Longtime User Oct 16, 2012 #2 Byte values range is -128 to +127. Integers are converted to bytes automatically.
agraham Expert Licensed User Longtime User Oct 16, 2012 #3 arenaluigi said: not receive any error? Max value Byte is 127 ? Click to expand... No, you do not get an error when converting an out of range number. The byte value you get when a larger value is converted is B4X: bytevalue = outofrangevalue AND 0xFF where 0x00 to 0x7F is interpreted as 0 to 127 and 0x80 to 0xFF is interpreted as -128 to -1
arenaluigi said: not receive any error? Max value Byte is 127 ? Click to expand... No, you do not get an error when converting an out of range number. The byte value you get when a larger value is converted is B4X: bytevalue = outofrangevalue AND 0xFF where 0x00 to 0x7F is interpreted as 0 to 127 and 0x80 to 0xFF is interpreted as -128 to -1