Hex To Dec

  • Thread starter Thread starter Chris Wilmot
  • Start date Start date
Is there a function for converting Hex To Dec

Val will do it (just prefix with &h), and there may be others...

Dim s as string = "FF"
Dim value as Integer

value = val( "&h" & s )

HTH

~
Jeremy
 
Chris,
In addition to the Val function.

You can use System.Convert.ToInt32(string, integer)

Dim i As Integer
i = Convert.ToInt32("abcd", 16)

Where the integer parameter is the base, in this case 16.

Hope this helps
Jay
 
Hello,

Chris Wilmot said:
Is there a function for converting Hex To Dec

\\\
Dim s As String = "0A"
MsgBox(CInt("&H" & s))
MsgBox(Convert.ToInt32(s, 16))
///

HTH,
Herfried K. Wagner
 
Back
Top