Results 1 to 4 of 4

Thread: [RESOLVED] Chr() and Asc() help

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2005
    Posts
    126

    [RESOLVED] Chr() and Asc() help

    Not sure if any of this will make sense without the whole code but...
    VB Code:
    1. For a = 1 To Len(Data)
    2. PrintText = PrintText & " " & ChrB(Asc(Right(Left(Data, 1), Len(Data) - a + 1)) + Keycode(a))
    3. 'MsgBox a
    4. 'MsgBox ChrB(Asc(Right(Left(Data, a), Len(Data) - a + 1)) + Keycode(a))
    5. Next
    6. 'MsgBox PrintText
    Basically, it gets ever letter, switches to its ascii value, adds the variable Keycode to it, then changes back into Chr()

    Anywany, print text is supposed to string all the letters together, IE.

    If the first letter converts to "æ"
    then second letter converts to "£"
    and the third letter converts to "₧"
    printText should give the value "æ £ ₧"

    But for some reason it ends up with "??Ü" or something similar

    I have the msgbox's to check that the letters are being evaluated properly, and they are, but the PrintText is getting messed up somewhere




    Edit: Added [vbcode][/vbcode] tags for clairty. - Hack
    Last edited by Robert123; Aug 26th, 2005 at 09:25 AM.

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