Waiting for a macro to complete

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
bernie
Junior Coder
Posts: 47
Joined: Sun Sep 22, 2002 4:16 pm
Location: Virginia

Waiting for a macro to complete

Post by bernie » Wed Feb 05, 2003 3:05 am

I don't know if this is an XP thing or a 7.1 problem [I'm just moving my world to my new XP system and slowly migrating all my msched macros over], BUT: I was pretty sure that when you did
Macro>OTHERMACRO
that it *waited* for the other macro to finish before it proceeded. I checked the help file for "Macro>" and it was silent on the matter. But I'm getting nailed because my 'call' isn't waiting for the macro to finish.

Here's the macro doing the calling:
2/4/2003 21:59:06:000 -
2/4/2003 21:59:06:000 - Macro>Dial GVA
2/4/2003 21:59:06:000 -
2/4/2003 21:59:06:000 - Let>RP_WINDOWMODE=2
2/4/2003 21:59:06:000 -

Notice that *NO* time elapsed from the "Macro>" to the "Let>". But when I look at the log for the other macro [Dial GVA] I have:

2/4/2003 21:59:06:765 - Started Macro : Dial GVA
[...]
2/4/2003 21:59:37:843 - Finished Macro : Dial GVA

Notice that the macro took 31 seconds. Is there some new thing about making one macro *wait* for another to finish before it proceeds?

Thanks!
/Bernie\

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Wed Feb 05, 2003 8:29 am

Hi,

In 7.1 you need to do:

Macro>c:\fullpath\macrofile.scp

Please see:
http://www.mjtnet.com/forum/viewtopic.php?t=56

That's the problem.
MJT Net Support
[email protected]

bernie
Junior Coder
Posts: 47
Joined: Sun Sep 22, 2002 4:16 pm
Location: Virginia

Post by bernie » Wed Feb 05, 2003 12:13 pm

Ah, I didn't see that in the announcements [and it didn't make it into the help file, alas]. I hope that what it says in the note [that you probably only need the .scp] is correct, because otherwise it'll be a pretty unfortunate decision for me:

I move my macros around and re-organize them from time to time, and if I need to put in a full path I'll a hve to edit a LOT Of macros to change the path all around UGH. Oh well...

What's odd is that the effect of only using the macro name wasn't that it couldn't *find* the other macro just fine, but it just didn't _wait_ for it to finish,... so maybe that's a programming trick for us folk who won't be using the compiler: if you use just the macro name, msched launches-and-goes, but if you use the full-path it launches-and-waits.
/Bernie\

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Wed Feb 05, 2003 2:40 pm

Hi,

Not sure which help file you're looking at, 'cos it's in mine - both under the Macro command topic and in the history list.

Check you have the correct help file installed. Should have installed the new one with the new version. Do you have the latest release installed?
MJT Net Support
[email protected]

bernie
Junior Coder
Posts: 47
Joined: Sun Sep 22, 2002 4:16 pm
Location: Virginia

Post by bernie » Wed Feb 05, 2003 2:47 pm

I'm running 7.1.6, which is close to the latest version, yes?

The help file just says:
Executes another macro. The specified macro must exist in the current installation of Macro Scheduler. It must be a valid macro that appears in the macro list on Macro Scheduler's main form.
/Bernie\

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Wed Feb 05, 2003 2:53 pm

Hi,

The latest is 7.1.15 so there have been a few updates since the one you have - I'd download 7.1.15 from http://www.mjtnet.com/dldregd.htm

Perhaps the help file wasn't modified until just after the one you have.
MJT Net Support
[email protected]

bernie
Junior Coder
Posts: 47
Joined: Sun Sep 22, 2002 4:16 pm
Location: Virginia

Post by bernie » Wed Feb 05, 2003 8:24 pm

That did it -- I upgraded to 7.1.15 and the warnings about the change to "Macro>" were loud and clear. Broke a huge number of macros of mine, but I'll survive. :)

Is there an updated version of the PDF documentation that corresponds to 7.1.15?

Thanks!
/Bernie\

User avatar
Captive
Macro Veteran
Posts: 213
Joined: Sun Oct 20, 2002 8:37 pm
Location: Colorado, USA

Post by Captive » Sat Feb 08, 2003 6:33 pm

Something which may reduce the troubles that this /.scp change causes, would be the ability to obtain the current working directory and/or the directory that the currently running script is in.

If there's already a way to do this, then great! Someone tell. :)
Something like....

%CWD% = Current Working Directory
The one that is changed by the Cha>xxx command.

%SLD% = Script Location Directory
The directory that this script is in.

I have a Macro that currently is simply:
Macro>GetFELogs

And it works! When I added the .scp on the end, it fails (cannot find...). The GetFELogs.scp is in the same directory as the other script, and is also listed in MSChed (but under a different group). I haven't tried using the full path method.
(version 7.1.15)

bernie
Junior Coder
Posts: 47
Joined: Sun Sep 22, 2002 4:16 pm
Location: Virginia

Post by bernie » Sat Feb 08, 2003 8:56 pm

Captive wrote:Something which may reduce the troubles that this /.scp change causes, would be the ability to obtain the current working directory and/or the directory that the currently running script is in.
I agree -- it'd be nice if there were a way to both allow Marcus to do the compiler and not have to hardcode a lot of directory names into our scripts!
Captive wrote: I have a Macro that currently is simply:
Macro>GetFELogs

And it works! When I added the .scp on the end, it fails (cannot find...).
I had the same experience. Doulbe check on the first form: I think you'll find that while it found your script it didn't wait for it to complet.
But when I put i the full path, then the wait-until-it-completes functionality reappeared [as I was counting on!].

So I'm wondering if this is a bug/misfeature: [and one I hesitate to recommend that anyone take advantage of]: if you do
Macro>fullpath
you get the wait-until-complete functionality, while if you do
Macro>macroname
you get the "start the other macro and then keep going" functionality.
/Bernie\

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Mon Feb 10, 2003 12:55 pm

bernie wrote:
Is there an updated version of the PDF documentation that corresponds to 7.1.15?

Thanks!
Yes, it was updated at the same time and is available http://www.mjtnet.com/support.htm
MJT Net Support
[email protected]

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