PDA

Click to See Complete Forum and Search --> : Display text and the hex format


herzl
Nov 17th, 1999, 12:00 PM
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

Mark Sreeves
Nov 17th, 1999, 02:25 PM
Write a function to convert the string....



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

Mark.Sreeves@Softlab.co.uk
A BMW Group Company

herzl
Nov 17th, 1999, 09:23 PM
Thanks