Jump to content
aa2zz6

Using an If Then sleep statement

Recommended Posts

aa2zz6
Posted (edited)

Can someone explain how sleep works without defining an actual delay time. I figured it wouldn't work without a delay but it does after an If Then statement. Thanks :)

If ProcessExists("Setup.exe") Then Sleep

 

Edited by aa2zz6

Share this post


Link to post
Share on other sites
TheXman
Posted (edited)
12 minutes ago, aa2zz6 said:

Can someone explain how sleep works without defining an actual delay time

Actually, it doesn't.  If the process doesn't exist, it won't try to execute the statement.  If the process does exist, you will get a runtime error.

What lead you to believe that it did work?  Did you not try it for yourself?

Edited by TheXman
  • Thanks 1

Whoever said that there's no such thing as a dumb question, probably asked a lot of DUMB questions.  Dumb questions are ones that you can easily find the answer to on your own.

Share this post


Link to post
Share on other sites
JLogan3o13

@aa2zz6 if you were using the full SciTE, that would throw a syntax error before it even got started:

Quote

"C:\Users\JLogan\Desktop\Test2.au3" (1) : ==> Error parsing function call.:

if ProcessExists("Notepad.exe") Then Sleep
if ProcessExists("Notepad.exe") Then ^ ERROR
 

 

  • Thanks 1

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
aa2zz6

hmm, okay, I will need to look at this.

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

×