I am parsing incoming serial HEX strings and can’t figure out how to have the leading zeros of HEX characters 01 through 0F display. I use this bit of code in DataAvailable to display the returned string in EditField0:
for i as Integer = 0 to StrLen - 1
EditField0.AppendText Str(Hex(mb.byte(i)))
ByteNum= ByteNum+1
Next i
Now, for example, the string displays as “54212318584”. The actual HEX is “05 04 02 12 31 85 84” and I need it to display as “05040212318584”. How do I keep the leading zeros of each HEX character?