Jump to content
Macro Express Forums

Macro Return vs. Macro Stop


ejs
 Share

Recommended Posts

According to the macro express help file, Macro Return is used in conjunction with Macro Run. Macro A calls Macro B; use Macro Return in condition logic within Macro B to prematurely stop Macro B and return play back to Macro A.

 

In contrast, if Macro Stop is used in the condition logic in Macro B, the entire macro play back will stop. Macro B will stop but so will Macro A.

 

What if I want to have Macro B work as follows:

(i) if I run Macro B by activating Macro B directly (that is, not called by a Macro Run command from Macro A), and if Macro B satisfies my condition, then Macro B stops

(ii) if I run Macro B via a Macro Run command from Macro A, and if Macro B satisfies my condition, then Macro B stops and Macro A continues.

 

Case ii can use the Macro Return statement to stop B and return control to A. but I need a single approach that will work for case (i) AND (ii).

 

Can I still use Macro Return? If playback encounters Macro Return in a macro which was activated directly, does Macro Return do the same thing as Macro Stop.

 

This is not covered by the macro express help.

 

I gave it a try and it seems to work, but I wanted to ask this forum if I'm not overlooking any interactions and whether there is a better solution.

Link to comment
Share on other sites

I’m not sure about how it would work without doing some experiments and trying as you have already done so I can’t speak to that with any authority but if for some reason that doesn’t work why don’t you just use a variable. If the parent macro sets T99 to “This came from a macro” and when you do the “Macro Run” you could use the logic If T99 = “This came from a macro” then you know if it was executed by itself or called.

 

I'll be interested to hear what you find on your basic question though.

Link to comment
Share on other sites

What if I want to have Macro B work as follows:

(i) if I run Macro B by activating Macro B directly (that is, not called by a Macro Run command from Macro A), and if Macro B satisfies my condition, then Macro B stops

(ii) if I run Macro B via a Macro Run command from Macro A, and if Macro B satisfies my condition, then Macro B stops and Macro A continues.

 

Case ii can use the Macro Return statement to stop B and return control to A. but I need a single approach that will work for case (i) AND (ii).

 

Can I still use Macro Return? If playback encounters Macro Return in a macro which was activated directly, does Macro Return do the same thing as Macro Stop

Yes, you can use Macro Return in Macro B and it will work the way you describe.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...