ink Posted October 24, 2007 Share Posted October 24, 2007 how do i check if the box is empty the i press ok? While 1 $delay = InputBox("Question", "how much delay should there be between each mouse move?") If $delay = Not Number($delay) Then MsgBox(0, "Error", "that's not a number you have entered that's a character") Else ExitLoop EndIf WEnd Link to comment Share on other sites More sharing options...
Blue_Drache Posted October 24, 2007 Share Posted October 24, 2007 (edited) If $delay = Not Number($delay) OR $delay = "" then (Haha, beat you, weaponx) Edited October 24, 2007 by Blue_Drache Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
weaponx Posted October 24, 2007 Share Posted October 24, 2007 (edited) While 1 $delay = InputBox("Question", "how much delay should there be between each mouse move?") If $delay <> "" Then If Not IsNumber($delay) Then MsgBox(0, "Error", "Only numeric values are allowed") ContinueLoop EndIf ExitLoop EndIf WEnd EDIT: Blue_Drache does your mother sew? BOOM! Get her to sew that. -Clem (Joe Dirt) Edited October 24, 2007 by weaponx Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 24, 2007 Moderators Share Posted October 24, 2007 If $delay = Not Number($delay) OR $delay = "" then(Haha, beat you, weaponx) "Not Number"? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
weaponx Posted October 24, 2007 Share Posted October 24, 2007 "Not Number"? Oh snap! Blue_drache receives one demerit for lack of quality control. Too busy trying to oust WeaponX. Link to comment Share on other sites More sharing options...
Blue_Drache Posted October 24, 2007 Share Posted October 24, 2007 (edited) I was using the same pseudo-code the OP was. A more reliable check for a non number in a whole string is to use: $a_delay = StringSplit($delay,"") For $x = 1 to $a_delay(0) If Not Number($a_delay($x)) then MsgBox(0,"Error","Non-Neumeric in string!") EndIf Next Edited October 24, 2007 by Blue_Drache Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
ink Posted October 24, 2007 Author Share Posted October 24, 2007 im getting this error that i'm trying to run this and btw what should i use instead of numbers to check if its a number there's entered?(6) : ==> Error in expression.: If $delay = Not Number($delay) Or = "" Then If ^ ERRORWhile 1 $delay = InputBox("Question", "how much delay should there be between each mouse move?") If $delay = Not Number($delay) Or = "" Then MsgBox(0, "Error", "that's not a number you have entered that's a character") Else ExitLoop EndIf WEnd Link to comment Share on other sites More sharing options...
Blue_Drache Posted October 24, 2007 Share Posted October 24, 2007 (edited) If Not Number($delay) or $delay = "" then (see above post for more reliable check for non-neumeric in string, or better yet, Use weaponx's code) Edited October 24, 2007 by Blue_Drache Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
ink Posted October 24, 2007 Author Share Posted October 24, 2007 thx guys that worked Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 24, 2007 Moderators Share Posted October 24, 2007 (edited) My turn:While 1 $delay = InputBox("Question", "how much delay should there be between each mouse move?") If StringRegExp($delay, "^\d+$") = 0 Then MsgBox(0, "Error", "Only numeric values are allowed") ContinueLoop EndIf ExitLoop WEnd Edit: Had wrong var in StringRegExp Edited October 24, 2007 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Blue_Drache Posted October 24, 2007 Share Posted October 24, 2007 LOL. Yeah, StringRegExp is a language in and of itself. Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache 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