Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pausing between macros
#1
I have a macro that calls two different macros at the end of its code but I need it to wait until the first one finishes before it starts the second one.
Any ideas how I can do this?

Thanks.


Attached Files
.zip   ME10.zip (Size: 168.61 KB / Downloads: 341)
#2
If you want just to synchronize two macros so that the last macro would not be lost, all is simple. If all three items are "Macro" (not "Function"), this hapens automatically when main macro (one that launches two others) ends. If main macro actually is "Function", go to the Properties dialog of the last macro and select On conflict: Wait.

If main macro actually must wait for another macro launched by mac, or another macros actually are functions, then you need QM 2.1.2. Now mac returns thread handle, and wait function can wait for it. There is example under wait. Of course it will not work if caller and callee both are "Macro".
#3
Well I got a bit confused as to how to instigate the code, howeve, I updated to 2.1.2 and it works great!!!!

THANKS... Big Grin
#4
2.1.5 build 6

I'm running the above version and I"m having some problems with one of my macros. I have a macro that runs another macro and needs to wait before it continues with another macro but it is just running down the list. Changing the above settings doesn't help and these are all macros.

Is there a way to do this without converting everything to functions or creating some sort of global variable check loop?

Thanks.
#5
No. Why you don't want to convert them to functions and simply call?

Code:
Copy      Help
...
Function1
Function2
Function3
...
#6
oh, i didn't realize it was that easy.
...
..
.
wait, its still not waiting on them. do i have to do that
Code:
Copy      Help
int hThread=mac("Function")
wait 0 H hThread

thing?
#7
No, unless you want to run these functions in separate threads.

Quote:its still not waiting on them
- maybe I did not understand something?
#8
well, what I'm needing to do is to have it start one macro and then wait till it finishes then start the next one.
#9
It waits when you call these macros as functions, like in my example.
#10
I think I figured it out.
I think it is working the way I need it too but thought it wasn't cuz NS was choked up. so, when i went to test it i was using 2 macros the just had "bee" commands in them but didn't realize that only the "play" command keeps a thread open when playing a sound so the sounds were getting crushed against each other cuz only one instance of it can be heard at a time. does that sound about right?

freaking NetScape!

Edit--=--
Note to self: run functions as functions; don't call them with the "mac" command.


Forum Jump:


Users browsing this thread: 1 Guest(s)