HEX -> DEC in VB *question*

Discussion in 'OT Technology' started by Soace Munky, Apr 21, 2003.

  1. Soace Munky

    Soace Munky New Member

    Joined:
    Mar 31, 2003
    Messages:
    12,519
    Likes Received:
    0
    Location:
    philly, more or less
    I need to convert a hexadecimal value in VB6 into an integer. For some reason, I cannot find a function for that anywhere, I mean, theres gotta be one, right?

    for example, F14D -> 61773, is there something that will do something like
    Hex(MyHexVal) = MyDecVal

    Can anyone help me out, Ive been at this for a while, its getting me pretty frustrated.

    Any help would be greatly appreciated.
     
  2. SLED

    SLED build an idiot proof device and someone else will

    Joined:
    Sep 20, 2001
    Messages:
    28,118
    Likes Received:
    0
    Location:
    AZ, like a bauce!
    shouldn't have to convert at all. It's already an int unless it exceeds the storage space.

    Dim x as Integer
    x = &H11
     
  3. fob

    fob Member

    Joined:
    Oct 26, 2000
    Messages:
    219
    Likes Received:
    0
    Location:
    Orange County, CA
    Option Explicit

    Private Sub Command1_Click()
    Dim strDec As String

    strDec = CStr(Val("&H" & txtHex.Text))

    txtDec.Text = strDec

    End Sub
     

Share This Page