Jump to content
Macro Express Forums

T Variable Is For Temp? What For Permanently?


koden

Recommended Posts

You could use the Variable Modify String command to save the variable to a text file. This is found under the Option 2 Tab of the command. You could then use the Variable set String command in other macros to load the information from the text file into your variable.

Link to comment
Share on other sites

Variables are not stored between different macros, i.e. there are no "global" variables. That is one of the major weaknesses in Macex.

 

You can use the Variable Save command to do what you need. However, it is a really kludgy solution.

 

For example, if you have two macros and want to pass data back and forth.

 

Basically, you need to issue a variable save command in the first macro. Then you issue a variable restore command in the second macro. To pass data from the second to first macro, you reverse the process.

 

In addition, the variable save/restore command has its own limitations. You can only save/restore all text variables at once, which means you have to be careful when you restore because it will overwrite all existing variables from T1 to T99.

 

Like I said, a real kludge.

Link to comment
Share on other sites

The Variable Save and Variable Restore commands will only work if you do not run another macro in between the macros that use variable commands, and you do not shut Macro Express down in between the macros. The variable values are all set to 0 when Macro Express is restarted or a macro is run using the variable commands.

Link to comment
Share on other sites

There are a variety of ways to save and restore variables.

  • In memory via the Variable Save/Restore commands.
  • In one or more .ini files.
  • In environment variables
  • In one or more text files.

For example:

// Save / restore all text variables (%Tx%)
Variable Save Text Variables
Variable Restore Text Variables

// Save / restore all variables
Variable Save All Variables
Variable Restore All Variables

// Save / restore a single variable using an .INI file
Variable Modify String: Save %T1% to INI File
Variable Set String %T1% from INI File

// Save / restore a single variable using the environment variables
Variable Modify String: Save %T1% to Environment Variable
Variable Set String %T1% from Environment Variable

// Save / restore a single variable using a text file
Variable Modify String: Save %T1% to Text File
Variable Set String %T1% from File: "T1"

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