Results 1 to 3 of 3

Thread: Display text and the hex format

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 1999
    Posts
    7

    Post

    Hi,
    Is there a fast way to display a long string in a text box with 2 different format - the chr and the hex of the string ?
    somthing like :

    0123456789 30 31 32 33 34 35 36 37 38 39

    Thanks

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845

    Post

    Write a function to convert the string....


    Code:
    Option Explicit
    
    Private Sub Command1_Click()
    Text1 = Text1 & HexIt("0123456789")
    End Sub
    
    Function HexIt(strIn As String) As String
    Dim i As Integer
    Dim strOut As String
    
    For i = 1 To Len(strIn)
      strOut = strOut & Hex(Asc(Mid(strIn, i))) & Space(1)
    Next
    
    HexIt = strIn & Space(1) & strOut & vbCrLf
    End Function
    ------------------
    Mark Sreeves
    Analyst Programmer

    [email protected]
    A BMW Group Company

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 1999
    Posts
    7

    Post

    Thanks

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