Jump to content
Macro Express Forums

More On Run Macro In Variable


jmb4370
 Share

Recommended Posts

After working through all the helpful examples in this forum and in the book MacroExpressExplained, I got my macro to work, but I found a little quirk that I think is worth mentioning. The command that gets run by the Run Macro in Variable command is the Variable Modify String command. I noticed when the command was viewed in the direct editor, the variables are referred to with two digits (01, 02, 03 etc). If my dynamic variable had only a one digit value, the command needed a '0' preceding the variable name, or the entire program of Macro Express would crash! I ended up using a simple IF statement to write the command both with and without the extra '0' for single or double digit values of the replaceable variable, N1

 

Repeat Until %T1% <> %T1%

If Variable %N1% <=9

Variable Set String %T1% "<TMVAR2:09:01:0%N1%:000:000:>"

Else

If Variable %N1% >=10

Variable Set String %T1% "<TMVAR2:09:01:%N1%:000:000:>"

End If

End If

Run Macro in Variable %T1%

...

...

...

End Repeat

Link to comment
Share on other sites

Yes. Most, but not all, of the sections within a Macro Express command are a fixed length. This can look real strange for coordinate positioning fields, which will accept literal, variable, and text values:

:000000:
:000256:
:00%N2%:
:0%N88%:
:Center:
:Bottom:
:000Top:

are all six characters in length.

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

×
×
  • Create New...