cyanidemonkey Posted December 19, 2005 Posted December 19, 2005 I am wondering how I can error check an input box to stop user from inputing a double quote. I know to avoid an error I have to double up the double quotes, but users won't. How can I detect a double quote and return a friendly error? If I use: StringInStr("I am "a" String", """) OR StringInStr("I am {"}a{"} String", "{"}") I get a script error My AutoIt Scripts.- AutoHost and Password Enabler for Delta Force 2 Demo.| Caffine for Winamp 2.9x and WRS 2.0 | mp3 directory cleaner | CRAP DJ | A:B:J Radio Automation Software | FFMPEG batch conversion automator
Valuater Posted December 19, 2005 Posted December 19, 2005 maybe like this $answer = InputBox("Question", "Where were you born?", "Planet Earth", "", _ -1, -1, 0, 0) if StringInStr($answer, '""') Then MsgBox(64,"Input Error", "Please do not use double quotes", 5 ) EndIf 8)
Danny35d Posted December 19, 2005 Posted December 19, 2005 cyanidemonkey it is kind of hard to help you without a part of code but, you can used StringReplace():StringReplace($InputBox, '"', '')and this will remove any double quote from the string. AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line
cyanidemonkey Posted December 19, 2005 Author Posted December 19, 2005 DOH!, of course, thanks guys,. I should have my morning coffee before attempting to code anything... My AutoIt Scripts.- AutoHost and Password Enabler for Delta Force 2 Demo.| Caffine for Winamp 2.9x and WRS 2.0 | mp3 directory cleaner | CRAP DJ | A:B:J Radio Automation Software | FFMPEG batch conversion automator
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