terrypin Posted October 24, 2016 Report Share Posted October 24, 2016 I've always wondered why MX Pro wasn't coded to automatically define any variables that are inherited from a submacro, but just accepted the chore of doing it manually. However I've just noticed that it has apparently captured and stored these, so I'm puzzled why that very useful extra step of adding them automatically was not implemented? In case that wasn't clear: Macro-A contains Macro-B. Macro B uses variable XYZ and at its end includes a Variable Save. But if I run Macro-A, which starts with a Variable Restore, XYZ cannot be displayed in a TBD command, for example. Yet, directly after running Macro-A in debug mode with F9 and then using F5, XYZ is included in the displayed list. It's no big problem, of course, but it would be helpful when developing a complex macro to have any restored variables added automatically under the Variables tab. -- Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
Cory Posted October 24, 2016 Report Share Posted October 24, 2016 I don't have a lot of time to consider your question so I might be off base here. What I can say is MEP once confused me on this matter and once I understood it everything they do makes perfect sense. Have you considered scope? Read my paper here if you think it might be of use. Quote Link to comment Share on other sites More sharing options...
terrypin Posted October 26, 2016 Author Report Share Posted October 26, 2016 Thanks, but I don't think this is a scope issue. It's simply that the parent macro apparently recognises the submacro's variables (because it shows them in the F5 list), yet it doesn't make them available to the macro itself. Quote Link to comment Share on other sites More sharing options...
Cory Posted October 26, 2016 Report Share Posted October 26, 2016 That sounds like scope to me but I could be wrong. 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.