Jump to content
Macro Express Forums

Need Long/multiple-char Proper Names For Variables


jamesme

Recommended Posts

I would like MacroExpress to be changed so that multiple character names for variables can be used, instead of the current single character.

 

This would make the variable names meaningful, so that:

- scripts are easier to understand, e.g. %PIXEL_COLOR% instead of %N1%

- scripts are easier to debug

- scripts are easier to add new features to. With proper names for variables, the author would not have to think about which variables had already been used. They simple define a new variable with a new name.

 

Most other scripting languages allow proper name variables.

Link to comment
Share on other sites

Your suggestion is noted and is being considered for a future release of Macro Express.

 

Note that Feature Requests can be made directly to Insight Software Solutions from the http://www.macros.com/requestfeature.htm web page. We again thank Professional Grade Macros for hosting the Macro Express discussion forum.

 

For now, I suggest you try using environment variables. Environment variables are discussed in the Macro Express help under the topics Modify String Variables and Set String Variables. They are also described on pages 185 and 228-229 in the book Macro Express Explained.

 

Once set, an environment variable can be used anywhere a string variable (%T1%) can be used. There are several environment variables set automatically by Windows. For example, suppose you want to know where the TEMP folder is on your computer. Simply use %TEMP% in any macro command.

 

Environment variables can be as long or as short as you like. However, Windows imposes a limit. In Windows ME, 98 and 95 there is a default limit of 4,096 bytes (this limit can be increased). In Windows XP, 2000 and NT there is a limit of 32,768 bytes. The number of bytes includes the names and content of all environment variables. And, as noted, Windows automatically creates some environment variables.

 

Set an environment variable this way:

Variable Set String %T1%"Insight Software Solutions"
Variable Modify String: Save %T1% to Environment Variable

Assuming the Environment Variable you used is named 'Company Name' you could then include %CompanyName% in your macro:

Text Type: %CompanyName%

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