Jump to content
Macro Express Forums

All active variables in macro


Recommended Posts

In the Help screens, look up Debug. IF you are testing the macro in the scripting editor, you can set a breakpoint and get a display of variable values with Debug when the break occurs.


Personally, I would write a simple macro that writes messages to the log file displaying all the variables. Then you could call (Macro Run) the display macro at any point(s) you want within the macro you are debugging, and examine the results at your leisure. To see only active variables, you could do something simple like:

If Variable %T1% <> ""
Log Message to Default Error Log [message text T1 value is "%T1%"]
End If

If Variable %T2% <> ""
Log Message to Default Error Log [message text T2 value is "%T2%"]
End If


If Variable %N1% <> 0
Log Message to Default Error Log [message text N1 value is "%N1%"]
End If


It's kind of a pain to write the variable-display macro initially, but once it is done you can use it forever, wherever you want.


Example: You have written the macro Debugger_Display_Variables, so wherever you are concerned in a macro you are testing, insert

Log Message to Default Error Log [message text "Debugging macro ABC at point XYZ"]

Macro Run: Debugger_Display_Variables

When you look in the log file you will see the message about which macro is being debugged, followed by the messages for all the individual variables.

Link to comment
Share on other sites

The sample macros (samples.mex) contain a list of variables that are used in remarks at the top of the macro. For example:

// Variables used:
//   T1  - Selection made in Multiple Choice Menu command
//   T2  - A message for the Text Box Display command
//   T3  - Windows version selected in Multiple Choice Menu

It is a little bit of work to do but a list like this sure helps when you edit the macro in the future.


I like the named variables in Macro Express Pro. It makes knowing which variables that are used a lot easier. It also makes it less necessary to know what variables are used.

Link to comment
Share on other sites

Agreed. I wrote several extensive "screen scraper" applications consisting of dozens of ME3 macros. The single most crucial document involved was a Word file describing variable use as values were passed among macros. ME Pro would have made that simpler, but I think the documentation would still have been needed. Even meaningful variable names often are not fully self-describing.

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.

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.

  • Create New...