Results 1 to 3 of 3

Thread: Converting hexadecimal to decimal

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2000
    Location
    Manchester, UK
    Posts
    50

    Cool

    There is a function Hex() to convert decimal numbers to hexadecimal numbers, but there seems to be no function to convert hexadecimal into decimal. Does anyone know how to do this?

  2. #2

  3. #3
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Boulder, Colorado, USA
    Posts
    325
    Wouldn't it be easier to do something like so:

    Code:
    Public Function Hex2Dec(ByVal strHex As String, ByRef lngRet As Long) As Boolean
      
      On Error Goto CON_ERR
      
      '' return flag set as invalid data
      Hex2Dec = False
      
      '' this should cause an error if the hex string is invalid
      lngRet = CLng("&H" & strHex)
      
      '' return flag set as valid data
      Hex2Dec = True
      
    CON_ERR:
    End Function
    just an idea.
    -Shickadance

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width