Jump to content
Macro Express Forums

Global variables


Recommended Posts

It seems that if you have Macro1 which places a value in %Newvar% (defined as a global variable), then calls Macro2 which displays the contents of this variable, this works only if Macro1 is set to wait until Macro2 completes. If you set Macro2 to run asynchronously, then Macro2 will recognize %Newvar% only if:

- Macro1 saves text variables

- Macro2 restores text variables

- Macro2 uses %Newvar% as a global variable

 

Is that how it's supposed to be?

Link to comment
Share on other sites

This is correct. When a macro dies it takes it's variables with it. I think I have a pretty good understanding now of the global/local nature of the variables work in MEP but I hadn't considered much the 'wait for macro to complete' not being enabled so I ran some tests. I thought one could define the variable in the called macro as global as a solution but the value is lost.

 

I don't call macros in this way usually but you make a good point that this appears to make it impossible to pass variables from the parent macro when using this method. And it woul be dumb to have to jump thru the var save hoops. Maybe it's something you should 'request' from ISS.

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...