Cory Posted January 30, 2009 Report Share Posted January 30, 2009 Can someone please describe to me the nature and interaction of global and local variables with respect to concurrent macro execution? IE if I have a string %file% in one macro and another executes and sets %file% to something else in another macro does that change it for the first macro? If they all play in the same variable sandbox will I insulate myself if I make most of my variables local? IE only use globals where I really need to? Quote Link to comment Share on other sites More sharing options...
stan Posted February 3, 2009 Report Share Posted February 3, 2009 Let's say macro 1 uses the Variable Save command and saves variable T1 to memory. Macro 2 is run slightly after the first macro. It also uses the Variable save command and saves a different value to variable T1. Macro 3 runs the Variable Restore command. The value saved to T1 in macro 2 is the value restored. It was the last variable saved and overwrote the value in macro 1. Global variables called in a Macro Run command use the values from the parent macro. They will not get confused with a separate running macro that uses the same variable name. In this case they each have their own sandbox to play in. Quote Link to comment Share on other sites More sharing options...
Cory Posted February 4, 2009 Author Report Share Posted February 4, 2009 Thanks Stan. I wasn't asking about save/restore but that's good to know too. I just needed to know the sandbox rule. 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.