VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Hex to Decimal converter

by Luc Belliveau (1 Submission)
Category: Math/Dates
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Tue 4th June 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Hex to Decimal converter

Rate Hex to Decimal converter



  Select Case UCase(Num)
  Case "A"
    HexNumValue = 10
  Case "B"
    HexNumValue = 11
  Case "C"
    HexNumValue = 12
  Case "D"
    HexNumValue = 13
  Case "E"
    HexNumValue = 14
  Case "F"
    HexNumValue = 15
  Case Else
    HexNumValue = Val(Num)
  End Select
End Function
Private Function Dec(ByVal HexNumber As String) As Long
  Dim ch As Integer
  Dim adder As Long
  For x = 1 To Len(HexNumber)
    ch = HexNumValue(Mid(HexNumber, x, 1))
    t = 16 ^ (Len(HexNumber) - x)
    adder = adder + (ch * t)
  Next x
  Dec = adder
End Function

Download this snippet    Add to My Saved Code

Hex to Decimal converter Comments

No comments have been posted about Hex to Decimal converter. Why not be the first to post a comment about Hex to Decimal converter.

Post your comment

Subject:
Message:
0/1000 characters