i have searched all over the help and tryed all the convert examples but they never convert hex values to the right number, it always leaves them as integer.
this is what i want
convert 9C to Unsigned -100
i tryed Convert.UInt16(9C) and it just says cannot convert
and System.BitConverter
if anyone knows a command to easily do this please tell ^_^

Help: Convert HEX to Unsigned?
cg_greg
thanks guys i got it working, this is what i used
Function ar_ConvertToUnsignedInteger%(ByVal Bytes&) If Bytes& > 127 Thenar_ConvertToUnsignedInteger% = Bytes& - 256
Elsear_ConvertToUnsignedInteger% = Bytes&
End If End FunctionVoodoo45
"Assuming you just want to convert bytes in the range &H00..&HFF"
What other range can there be for bytes
Kooki
Public Function SignextendByte(ByVal value As Integer) As Integer
If value >= &H80 Then value = value - 256
Return value
End Function
Tomas R
I don't know what version of VB you are running but in vs2005 this works:
Dim
b As Byte = &H9CDim c As UShort = Convert.ToUInt16(b)
There is no Convert.UInt16(b)
Svenson21