Results 1 to 13 of 13

Thread: Ascii

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2006
    Posts
    49

    Unhappy Ascii

    Guyz how can I get all the characters (not in the keyboard) in a string and

    display it in another txtbox?

    txtbox1 = "™ÈñõŒ the dog ←ÖÜç"

    string1 = txtbox2

    txtbox2 = "™ÈñõŒ ←ÖÜç

    make it simple plss.

    Thanks....

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Ascii

    The Asc function will return the ascii character code for each character.
    VB Code:
    1. MsgBox Asc("™") '153
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    Member
    Join Date
    Feb 2006
    Posts
    49

    Re: Ascii

    yup i know that. But how can check if the word is not in the keyboard?

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Ascii

    Ok, which. Alpha, numeric, special characters, control chars, etc.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Ascii

    This will add only the captiol letters from A-Z to textbox 2.
    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Command1_Click()
    4.  
    5.     Dim i As Integer
    6.    
    7.     For i = 1 To Len(Text1.Text)
    8.         If Asc(Mid$(Text1.Text, i, 1)) > 65 And Asc(Mid$(Text1.Text, i, 1)) < 90 Then
    9.             Text2.Text = Text2.Text & Asc(Mid$(Text1.Text, i, 1)) & ","
    10.         Else
    11.             MsgBox Mid$(Text1.Text, i, 1) & " Is not within the acceptable range of characters allowed."
    12.         End If
    13.     Next
    14.    
    15. End Sub
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  6. #6

    Thread Starter
    Member
    Join Date
    Feb 2006
    Posts
    49

    Re: Ascii

    Thanks robdog

    Originally posted by RobDog888

    Ok, which. Alpha, numeric, special characters, control chars, etc.
    All of them..

    How can check if the all the characters in a single word is all ASCII

    characters? If true put it in the txtbox2.

    Thanks....

  7. #7
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Ascii

    My code checks each character in the textbox. Then you need to include the characters you want in the If statement. Maybe change it to a select case statement block since it will get larger to include all keyboard characters.

    So what will be the offending characters if they are not on the keyboard?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  8. #8
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Ascii

    On my Swedish keyboard I'll have an Ö key, as well as Å and Ä. In Swedish these are not just oumlated O and A characters, they are actual letters in our alphabet which differs from O and A in the same way as a B is different from a Q.

  9. #9
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Ascii

    Well yes thats what I was getting at. Its easier to trap for the extended keys or such instead of everything else.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  10. #10
    Frenzied Member Spajeoly's Avatar
    Join Date
    Mar 2003
    Location
    Utah
    Posts
    1,068

    Re: Ascii

    I recently had to do this at work and I just made a loop to remove all Non 7-bit ASCII characters as they cause.... Problems for us. The loop just goes....
    VB Code:
    1. For i = 128 To 255
    2.    If InStr(1, String, Chr(i)) then
    3.       'Stuff to deal with it here..
    4.    End If
    5. Next

    That's a rough break down as I wrote it in VBA for Excel originally.

    Hope that offers some help.

  11. #11

    Thread Starter
    Member
    Join Date
    Feb 2006
    Posts
    49

    Re: Ascii

    Thanks guyz...
    Spajeoly, Joacim, RobDog888

    I'll just create a case statement

    i didn't know that such characters exist in Swedish keyboard

    I'm talking about the ordinary keyboard. The standard I think..

    Thank you so much guyz. It helped me a lot. Now I know. bb

  12. #12
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Ascii

    Quote Originally Posted by myrea
    I'm talking about the ordinary keyboard. The standard I think..
    LOL, I have a ordinary standard (Swedish) keyboard. American keyboards aren't that very ordinary over here.

  13. #13
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Re: Ascii

    I agree with that guy
    Chris

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