Results 1 to 9 of 9

Thread: Convert from hex and oct

  1. #1

    Thread Starter
    Addicted Member Mars-Martian's Avatar
    Join Date
    May 2002
    Location
    Canada
    Posts
    185

    Question Convert from hex and oct

    I know converting to hex is Hex() whats converting from hex and oct?
    First person to be able to get what song is currently playing in Winamp 3.

  2. #2
    New Member
    Join Date
    Nov 2002
    Posts
    4
    conavetna what to whaoct? you not is makan sens

  3. #3
    Hyperactive Member Q_Me's Avatar
    Join Date
    Dec 2001
    Posts
    327
    53323737 15 743 313402 05 740313063. 17 15 4150 743 313402 05 140393403437 5203 743 30210.


  4. #4
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429

    Re: Convert from hex and oct

    Originally posted by Mars-Martian
    I know converting to hex is Hex() whats converting from hex and oct?
    Mars,

    There isn't a built in Function to do Hex to Dec OR Oct to Dec.

    However, there have been numerous posts on a Hex/Oct to Decimal converters
    posted at the Forum. Do a search using keyword "Converter".

  5. #5
    Hyperactive Member Q_Me's Avatar
    Join Date
    Dec 2001
    Posts
    327
    Little late on that post there Fox.
    53323737 15 743 313402 05 740313063. 17 15 4150 743 313402 05 140393403437 5203 743 30210.


  6. #6
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429


    I actually was researching my answer; I had a quick flick
    tru my VB6 Programmers Reference book for alternates!

  7. #7

    Thread Starter
    Addicted Member Mars-Martian's Avatar
    Join Date
    May 2002
    Location
    Canada
    Posts
    185
    thank you all for the hex converting
    *bows*
    now does anyone know converting from oct to dec?
    First person to be able to get what song is currently playing in Winamp 3.

  8. #8
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    Just modify (as required) the HexToInt post to:

    VB Code:
    1. OctToInt = Val("&[b]o[/b]" & OctDat)

    I'll stick it in a Function.......

  9. #9
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    Based on DiGiTalErRoR code, like:
    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Form_Load()
    4.  
    5.    MsgBox HexOctToInt("FF", "&h")    ' Pass a Hex value to Convert
    6.    MsgBox HexOctToInt("10", "&o")    ' Pass an Octal value to Convert
    7.    
    8. End Sub
    9.  
    10. Function HexOctToInt(ByVal HexOctDat As String, ConType As String) As Integer
    11.  
    12.    HexOctToInt = Val(ConType & HexOctDat)
    13.  
    14. End Function

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