Android Question Signed and Unsigned int

Hirogens

Active Member
Licensed User
Longtime User
Hello again, I try to use Signed Int but all my values in the log console are unsigned.
I have a string which contain Hexa value (FF-F1) and I would like to print -15 in decimal. How can I do this in B4A
Thanks
 

stevel05

Expert
Licensed User
Longtime User
Try this :
B4X:
Dim BC As ByteConverter
    Dim S As String = "F1"
    Dim B As Byte = BC.HexToBytes(S)(0)
    Log(B)
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Yes, the trick is casting to a byte.
 
Upvote 0
Top