Results 1 to 5 of 5

Thread: [RESOLVED] Arghh...

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2005
    Posts
    107

    Resolved [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 Attached Files

  2. #2
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    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:
    1. Option Explicit
    2.  
    3. Private Sub Command1_Click()
    4.     Dim ToConvert As String
    5.     ToConvert = Text1.Text
    6.     Text2.Text = String_Chr$(ToConvert)
    7. End Sub
    8.  
    9. Function String_Chr$(ByVal inString$)
    10.  
    11.     Dim lenString As Long
    12.     Dim tmpString As String
    13.  
    14.     For lenString = 1 To Len(inString) Step 2
    15.         tmpString = tmpString & "Chr$(""&H" & CStr(Mid$(inString, lenString, 2)) & """) & "
    16.     Next
    17.  
    18.     String_Chr = Left$(tmpString, Len(tmpString) - 3)
    19. End Function
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  3. #3
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: Arghh...

    6. Most people wont download code, you should post it with the syntax highlighting
    My usual boring signature: Something

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Feb 2005
    Posts
    107

    Re: Arghh...

    Thanks. That worked.

    I apologise for the failure of a thread... Very late and tired. Solved, thanks again

  5. #5
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    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
  •  



Click Here to Expand Forum to Full Width