Page 1 of 1

Help with RunWait

Posted: 18 Apr 2019, 05:53
by Evil-e
Can someone help me with how RunWait is used in a script?

The inital reason I posed this question, was a problem in a script for DiRT: 3. That issue was completely resolved, via Gosub command
thanks to guidance from swagfag :)

However, the means by which I suspect RunWait works within a thread, intrigues me and would like to experiment with it and see its
posibilities. After lots of research, the seemingly best thread is written in Deutsch and google translate leaves a bit to be desired. It appears
that RunWait executes AFTER another program is closed. If this is the case, I have some ideas of how I could introduce this command within
some scripts I already have working.


Re: Help with RunWait

Posted: 24 Apr 2019, 16:47
by Evil-e
Come on, pepes. Somebody who has opened this thread has an answer or a link that would help :)

here, I will do a little dance for ya.... :dance:

maybe a some encouragement would do the trick.... :bravo:

how's about a nice little friendly wave.... :wave:

did you know the purpose of reindeer? It is to make the grass grow, sweetie..? :lol:

did you know the difference between a hippo and a zippo..? One is heavy, while the other is a little lighter :lol:

an elf, a man and a wizard walk into a bar... the hobbit laughs as he walks under it :lol:

would if I shaved my beard..? :beard:

naaaa.... that ain't gonna happen :morebeard:

Re: Help with RunWait

Posted: 25 Apr 2019, 11:51
by gregster
It appears that RunWait executes AFTER another program is closed.
No, Runwait executes, but then waits... It just runs a program like Run does - but it waits until the program, that is has run, has finished/is closed. Not really another program... but exactly the program you specified.

Let's say you want to batch-process some pictures with Irfanview (or some other program) via command line. If your following code depends on the result of this processing, you should use Runwait instead of Run to run the program...

But sometimes there are things to consider, like in cases where there is a launcher-like program: wrote:Unlike Run, RunWait will wait until Target is closed or exits, at which time ErrorLevel will be set to the program's exit code (as a signed 32-bit integer). Some programs will appear to return immediately even though they are still running; these programs spawn another process.

Re: Help with RunWait

Posted: 25 Apr 2019, 14:15
by Evil-e
Oh.... OK, thanks :)

Not what I was hoping it would be, but just adds one more really cool thing that AHK can do :bravo:
This is good information that I will bank for future use, so it WILL find a way into something I write in the future :thumbup:

Thinkin' 'bout changin' it up a bit....

F that, :morebeard: