Jump to content
Macro Express Forums

Are global variable global to concurrent runs?


Recommended Posts

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?

Link to comment
Share on other sites

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.

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...
×
×
  • Create New...