Public Sub ConvertCode(pHexCode As String) As Int ' <---------------------------- this value is "007e"
if pHexCode.Length = 4 then '<------------------- Check length if 4 make it 8 otherwise not enough bytes to make ints
pHexCode = "0000" &pHexCode '<------------------- THIS line will make the code below work
end if '<-------------------
Dim bc As ByteConverter
Dim HexBytes() As Byte = bc.HexToBytes(pHexCode) '<-------------------- Gets converted to 2 byes 0 and 7E
Dim HexResult() As Int = bc.IntsFromBytes(HexBytes) '<-------------------- DOES not return anything
return HexResult(0) '<-------------------- FAILS because HexResult does not contain anything
end sub