Jump to content
Macro Express Forums

Global values


Recommended Posts



My version is 3.5c.


How do I establish global values and constants which is accessible to all macros?


For example, I have a common network folder I do work on. When that network folder changes I have to edit ten macros to the new location. It would be great to establish a global network folder value and have the ten macros pull from that common value. That way when my network folder changes all I need do is make the change at one place.


Do I have this feature or ability somewhere?




Link to comment
Share on other sites

There are several ways to save variable values for use in other macros. You can save to and restore from Environment variables, the Registry, an INI File and Text Files. You may also use the Variable Save and Variable Restore commands.


There is an example of saving a value between macros in the samples.mex sample macro file. This file should have been installed on your computer when you installed Macro Express. It may be in the c:\Program Files (x86)\Macro Express3 folder or it may be in your documents folder. Or you can download a copy from http://www.macros.com/samplemacros3.htm. (Do not try to use or edit the file in the Program Files (x86) folder. You should copy it to another location before using it. Windows prevents programs making changes to files in the Program Files (x86) folders.)


Once you find the samples.mex macro file look at the macro "Counter_From_Run_To_Run". This macro saves a value in the file TESTVAL.TXT located in your Windows Temp folder. It increments the value and saves it back out to TESTVAL.TXT. If you study this macro you can see how it is done.


For more detailed information about variables read the article How do Local and Global variables work and what is Variable Scope?


This article is written for Macro Express Pro and refers to variables like %Address% instead of something like %T1% but the concepts are the same for Macro Express 3. The section titled "Making information available to different macro threads" details the ways to save and load variables.

Link to comment
Share on other sites

By the way, you should upgrade from v 3.5c to the latest version. At the time of this writing the latest version is v 3.10b. There have been hundreds of bug fixes, enhancements and security patches since v 3.5c. Your Macro Express 3 license will work with the latest version. The Revision History contains a complete list of changes.

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