Tuesday, December 16, 2008

[vb6] Get value of a hexadecimal string expression

You can convert a numeric value to a hexadecimal string expression using the Hex$ function, but how do you do it the other way round ? Believe it or not, this simple function will do the trick:
    Public Function HxVal(s As String) As Long
HxVal = CLng("&H" & s)
End Function

No comments:

Post a Comment