serialzs Posted July 22, 2004 Share Posted July 22, 2004 @all how can i command the InputBox() accept only A to Z no numbers? and how can i do accept only one Character at a time? -=[serialzs]=- Link to comment Share on other sites More sharing options...
tutor2000 Posted July 22, 2004 Share Posted July 22, 2004 @all how can i command the InputBox() accept only A to Z no numbers? and how can i do accept only one Character at a time? -=[serialzs]=-I believe I have seen a isalpha function in the help file Check it out Rick Only $2.00 with Resale Rights How to Block Better for Martial Artists and NonMartial Artistshttp://kirkhamsebooks.com/MartialArts/Bloc...tterEbook_m.htm Link to comment Share on other sites More sharing options...
Nutster Posted July 22, 2004 Share Posted July 22, 2004 (edited) You can use a couple of undocumented features of the password field of the InputBox to do some of this. I have to get around to updating those docs. Use a space as the first character of the password. This way you can still see the characters that you type. The second character can be an M to indicate that input is Manditory; you must enter something. Nothing will happen if you press Ok when there is nothing in the inputbox. It will not close and return the value.You can also add the length of the string to be accepted. It will stop accepting characters when that number have been entered.For example:$x=InputBox("Title", "Prompt", "", " M2")This will require input (no empty strings accepted) and have a maximum length of 2.$pwd = InputBox("Login", "Enter your 6 character password.", "", "*6")This will display stars (*) for each character entered, but will let you press Ok with a blank inputbox, but you can enter no more than 6 characters.As for checking if the input is a alphabetic character, use StringIsAlpha to test.Do $x = InputBox("Testing", "Prompt", " M1") Until StringIsAlpha($x)Edit: Fix typos. Edited July 23, 2004 by Nutster David NuttallNuttall Computer Consulting An Aquarius born during the Age of Aquarius AutoIt allows me to re-invent the wheel so much faster. I'm off to write a wizard, a wonderful wizard of odd... Link to comment Share on other sites More sharing options...
trids Posted July 22, 2004 Share Posted July 22, 2004 Thanks for the cool tip, David! Link to comment Share on other sites More sharing options...
serialzs Posted July 23, 2004 Author Share Posted July 23, 2004 thanks for the reply i will try it... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now