Machtyn Posted July 1, 2005 Report Share Posted July 1, 2005 Here's my situation: I have two macros. Macro "A" performs certain functions and can be run by itself, if necessary. Macro "B" will call Macro "A" at a certain point. I want Macro "A" to perform certain lines but ignore certain other lines if it was called by Macro "B". Is this possible with a simple command (similar to If Macro Enabled/Disabled). I've thought to assign a variable in Macro "B" and have Macro "A" check it, but I'd prefer to keep away from using too many vars. What follows is a pseudocode example of what I'm talking about. Run Macro B Macro B: process stuff Macro B: call Macro A Macro A: process stuff Macro A: If not called by Macro B Macro A: do stuff Macro A: end if Macro A: do more stuff Macro A: if called by Macro B Macro A: return to Macro B Macro A: display dialogue showing end of macro Macro B: process stuff Macro B: display dialogue showing end of macro Thanks, Machtyn Quote Link to comment Share on other sites More sharing options...
cyberchief Posted July 1, 2005 Report Share Posted July 1, 2005 Hi, Machtyn. Welcome to the group. The only way I see this happening is... like you said.. set a variable in Macro B and set your If statements in Macro A (if varaible = macro b, then run commands). If you are concerned about using too many variables... just before you set the variable, do a variable save command. Set the variable, run macro A, and at the point it comes back to Macro B, do a variable restore. This way, you are not using up any variables. Quote Link to comment Share on other sites More sharing options...
Machtyn Posted July 1, 2005 Author Report Share Posted July 1, 2005 Great! Thanks for the help. I did like I mentioned (set a var) and it works proper. I'm not using a whole lot of variables, so it's really only a concern of keeping variables straight in my head (that's what comments are for, though, right ) Macro B: set %T99% to "Macro B" Macro A: if %T99% = "Macro B" Macro A: do stuff (such as return to Macro B) Macro A: do other stuff Macro A: if %T99% <> "Macro B" Macro A: do stuff, like display end of macro dialogue Quote Link to comment Share on other sites More sharing options...
lemming Posted November 14, 2005 Report Share Posted November 14, 2005 You might also consider the "Save to Environment Variable" capability under Variable Modify String. To read an env var, you can use the "Set Value from Environment Variable" under Variable Set String. -Lemming Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.