Sign in to follow this  
Followers 0
ink

Empty Check

11 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

If $delay = Not Number($delay) OR $delay = "" then

(Haha, beat you, weaponx)

Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

#3 ·  Posted (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 by weaponx

Share this post


Link to post
Share on other sites

If $delay = Not Number($delay) OR $delay = "" then

(Haha, beat you, weaponx)

<_< "Not Number"? :)

[center]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.[/center]

Share this post


Link to post
Share on other sites

<_< "Not Number"? :)

Oh snap! Blue_drache receives one demerit for lack of quality control. Too busy trying to oust WeaponX.

Share this post


Link to post
Share on other sites

#6 ·  Posted (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 by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

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 ^ ERROR

While 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

Share this post


Link to post
Share on other sites

#8 ·  Posted (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 by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

thx guys that worked

Share this post


Link to post
Share on other sites

#10 ·  Posted (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 by SmOke_N

[center]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.[/center]

Share this post


Link to post
Share on other sites

LOL. Yeah, StringRegExp is a language in and of itself.


Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0