by Dev Oasis (1 Submission)
Category: Math/Dates
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Originally Published: Tue 3rd December 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Convert Hex value to decimal equilivant. Great for color functions.
Dim LC As Long
Dim curHexValue As String
Dim curChar As String
Dim curValue As String
curHexValue = UCase(Trim(paraHexValue))
If Left(curHexValue, 2) = "&H" Then curHexValue = Mid(curHexValue, 3)
For LC = 1 To Len(curHexValue)
curChar = Mid(curHexValue, LC, 1)
If InStr(1, "ABCDEF", curChar) <> 0 Then curChar = Asc(curChar) - 55
curValue = Val(curValue) + (Val(curChar) * (16 ^ (Len(curHexValue) - LC)))
Next LC
Hex2Dec = Val(curValue)
End Function
No comments have been posted about Convert Hex value to decimal equilivant. Great for color functions.. Why not be the first to post a comment about Convert Hex value to decimal equilivant. Great for color functions..