Results 1 to 4 of 4

Thread: Conver Hex? to Chr() ?

  1. #1

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Conver Hex? to Chr() ?

    What is this:

    \xFE\xFD\x00\x10\x20\x30\x40\xFF\xFF\xFF\x01

    in Chr #'s?

    Chr(254) & chr(253) & Chr(0) & ??

    No clue! help!
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  2. #2
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    UK
    Posts
    417

    Re: Conver Hex? to Chr() ?

    Chr(254) & chr(253) & Chr(0) & chr(16) & chr(32) & chr(48) & chr(64) & chr(255) & chr(255) & chr(1)
    When your dreams come true.
    On error resume pulling hair out.

  3. #3
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: Conver Hex? to Chr() ?

    VB Code:
    1. Option Explicit
    2.  
    3. Public Function HexToStr(ByVal Hex1 As String) As String
    4.     Dim strTemp As String, strReturn As String, i As Long
    5.     Hex1 = Replace(Hex1, " ", "")
    6.     If Len(Hex1) Mod 2 <> 0 Then Exit Function
    7.  
    8.     For i = 1 To Len(Hex1) Step 2
    9.     strReturn = strReturn & Chr(Val("&H" & Mid(Hex1, i, 2))) & " "
    10.     Next i
    11.     HexToStr = Mid(strReturn, 1, Len(strReturn) - 1)
    12. End Function
    13.  
    14. Private Sub Form_Activate()
    15. Dim SpltStr() As String, i As Integer
    16. SpltStr() = Split(HexToStr("FE FD 00 10 20 30 40 FF FF FF 01"), " ")
    17.     For i = 0 To UBound(SpltStr)
    18.     If SpltStr(i) <> vbNullString Then MsgBox Asc(SpltStr(i))
    19.     Next i
    20. End Sub

  4. #4

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: Conver Hex? to Chr() ?

    I like that Remix.. cool

    Dream.. are u sure thats right? I came up with this:

    Chr$(254) & Chr$(253) & Chr$(0) & Chr$(4) & Chr$(5) & Chr$(6) & Chr$(7) & Chr$(255) & Chr$(255) & Chr$(255) & Chr$(1)

    which seems to work.. the server sends all the data back now!!
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

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