Apr 22nd, 2007, 10:33 PM
#1
Thread Starter
Lively Member
[RESOLVED] Arghh...
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.
Attached Files
Apr 22nd, 2007, 11:01 PM
#2
Re: Arghh...
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
Apr 22nd, 2007, 11:06 PM
#3
Re: Arghh...
6. Most people wont download code, you should post it with the syntax highlighting
My usual boring signature: Something
Apr 22nd, 2007, 11:16 PM
#4
Thread Starter
Lively Member
Re: Arghh...
Thanks. That worked.
I apologise for the failure of a thread... Very late and tired. Solved, thanks again
Apr 22nd, 2007, 11:18 PM
#5
Re: [RESOLVED] Arghh...
hey no problem. and thanks for the rep
My usual boring signature: Something
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width