H Hirogens Active Member Licensed User Longtime User Aug 2, 2018 #1 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
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 Aug 2, 2018 #2 Try this : B4X: Dim BC As ByteConverter Dim S As String = "F1" Dim B As Byte = BC.HexToBytes(S)(0) Log(B) Upvote 0
Try this : B4X: Dim BC As ByteConverter Dim S As String = "F1" Dim B As Byte = BC.HexToBytes(S)(0) Log(B)
H Hirogens Active Member Licensed User Longtime User Aug 3, 2018 #3 Thanks I use this B4X: Dim b As Byte b = Bit.ParseInt(your_string, 16) And it works =) Upvote 0
stevel05 Expert Licensed User Longtime User Aug 3, 2018 #4 Yes, the trick is casting to a byte. Upvote 0