Problem with If.....

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Ghost24de
Newbie
Posts: 13
Joined: Thu Aug 15, 2013 11:24 am

Problem with If.....

Post by Ghost24de » Fri Nov 15, 2013 10:43 am

Hello

i have the following problem.... i think its easy... but i cannt do it, or i dont see anything what is wrong... i dont know.... but i hope you can help me.

ok...
i have a if routine that look if the process Page_Runner.exe is running.
If they is running, he must wait a time (WaitTimePageRunner is here 60sec.)
then they must check it again... and so on.

my problem is, if the exe isn´t running, it works ok and got to the next label.
But if the process is running, they dont go to the next label, this is ok, but they dont wait and dont check it again.

Where is the failur from me?

....
....
....
Label>PagerunnerCheck
//Prüfen ob Page_Runner aktiv ist und evtl. warten
ProcessExists>Page_Runner.exe,Page_RunnerExists
If>Page_RunnerExists=False,PagerunnerCheckok
Endif
Wait>WaitTimePageRunner
Goto>PagerunnerCheck

Label>PagerunnerCheckok
....
....
....

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri Nov 15, 2013 2:36 pm

If I have understood you correctly you want to:

Code: Select all

1. See if a process exists
2. If the process exists:
    2.1 Wait some time
    2.2 Start again (loop back to 1)
3. If the process does NOT exist just carry on with the script.
If I am right then all you need is something like the following:

Code: Select all

Label>PageRunnerCheck
ProcessExists>Page_Runner.exe,Page_RunnerExists
If>Page_RunnerExists=True
  Wait>WaitTimePageRunner
  Goto>PageRunnerCheck
Endif
So this checks the existance of the process. If it exists it waits and then jumps back to the top. If it does not exist the script will just carry on below the Endif.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Ghost24de
Newbie
Posts: 13
Joined: Thu Aug 15, 2013 11:24 am

Post by Ghost24de » Sat Nov 16, 2013 1:33 am

Hi Marcus and the other one!
thanks for you message.... before i post, i have do it excactly how you write..... but it doesent work... and i think way.. and find no problem.

But now i have solve it.. the following works...

....
....
Label>PagerunnerCheck

//Prüfen ob Page_Runner aktiv ist und evtl. warten
ProcessExists>Page_Runner.exe,Page_RunnerExists
If>Page_RunnerExists=True
Let>Flaganmeldung=0
Wait>WaitTimePageRunner
Goto>PagerunnerCheck
Endif
....
....here are the next steps


But i ask me way, i think, thats the same how you write Marcus....ore i am wrong?

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Sat Nov 16, 2013 7:14 am

Yes, that is exactly the same as my code.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts