Please download this project. It's only a few lines but it's giving me a headache.
Instead of going "12 34 56" it's going "12 23 34". Please help, and thanks.
Printable View
Please download this project. It's only a few lines but it's giving me a headache.
Instead of going "12 34 56" it's going "12 23 34". Please help, and thanks.
Problems:
1. You don't have Option Explicit
2. You need to increase the loop counter by 2
3. Don't use + for concatening strings. Use the & operator.
4. What is your goal ? Do you want to find ASCII values of individual digits ?
5. Please give meaningful thread title. Thanks. :)
vb Code:
Option Explicit Private Sub Command1_Click() Dim ToConvert As String ToConvert = Text1.Text Text2.Text = String_Chr$(ToConvert) End Sub Function String_Chr$(ByVal inString$) Dim lenString As Long Dim tmpString As String For lenString = 1 To Len(inString) Step 2 tmpString = tmpString & "Chr$(""&H" & CStr(Mid$(inString, lenString, 2)) & """) & " Next String_Chr = Left$(tmpString, Len(tmpString) - 3) End Function
6. Most people wont download code, you should post it with the syntax highlighting
Thanks. That worked.
I apologise for the failure of a thread... Very late and tired. Solved, thanks again :)
hey no problem. and thanks for the rep ;)