Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Only allow keyboard characters in a string?

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,2759
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Only allow keyboard characters in a string?
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Only allow keyboard characters in a string? - 4/20/2005 1:47:18 PM   
  antun

 

Posts: 9
Score: 0
Joined: 4/20/2005
From:
Status: offline
Ok how would i get a string, and if it contains non keyboard characters discard it?

so if it contains ascii <32 and >126 discard it?????

so i have a word "HEY" it should be ok, but if i have a word "?oo" its not ok, because the first character is ascii 999

so it would need to check every characher in the string

Thanks?
 
 
Post #: 1
 
 Re: Only allow keyboard characters in a string? - 4/20/2005 2:37:33 PM   
  antun

 

Posts: 9
Score: 0
Joined: 4/20/2005
From:
Status: offline
I got it working

For j = 1 to Len(arr(i))
If Asc(Mid(arr(i), j, 1)) >126 Then
'do some stuff
End If
Next

(in reply to antun)
 
 
Post #: 2
 
 Re: Only allow keyboard characters in a string? - 4/21/2005 5:45:16 PM   
  token

 

Posts: 1917
Score: 0
Joined: 1/14/2005
From:
Status: offline
A easier way might be by the use of regular expression. If you want help with it, post your question and I'll try to answer it the best way I can.

(in reply to antun)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Only allow keyboard characters in a string? Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts