next up previous
Next: Macro Modifydb for Increasing Dimensions Up: EMME/2 NEWS 13 October 1992 Previous: Macro Command Language Gets Even

New Environment Variable E2MACROS

As the EMME/2 macro language gets more and more powerful, it becomes also very important to be able to organize and store these macros in a more systematic way.

Up to now, macros were either stored in the local directory, or they had to be invoked by specifying their full path specification. Both methods can have disadvantages. Storing macros in the application directory is fine as long as these macros are specific to this application. But if the macros will be used with several data banks, storing them locally leads to unnecessary file replications and, even worse might end up in having several incompatible versions. This can be avoided by storing the macros in separate directories, possibly grouped according to functionality or responsibility. However, up to now, this had the disadvantage that, to invoke these macros, one had to remember their exact location and had to enter their full file specification, e.g. ``~<c:\ntbmacro\balance3.mac'' instead of just ``~<balance3'',

In Release 6.0, a new path search mechanism to locate macros allows the user to specify a list of directories and/or file name extensions which are searched for the given macro name. This is implemented using the new environment variable E2MACROS. It contains, separated by semi-colons (;), the macro path specifications in the order that they have to be searched. If a question mark (?) is found in a path specification, it is used to substitute the interactively entered macro name (this allows e.g. to impose file extensions), otherwise the latter is simply appended.

The following example

   SET E2MACROS=?;?.MAC;C:\EMME2\MACROS\?.MAC;E:\NTPROJET\MACROS\
illustrates how, for an MS-DOS system, the E2MACROS variable can be set to search for macros in the following order:
  1. current directory or full path specification,
  2. current directory with file extension .MAC,
  3. in the standard EMME2\MACROS directory (for macros that are part of the official software distribution), using extension .MAC,
  4. in the site specific directory E:\NTPROJET\MACROS (note the trailing ``\'' at the end of the SET command).
For UNIX and VAX/VMS systems, the setting of the E2MACROS variable and the path specifications are done in a similar way, but they follow the rules imposed by the respective operating system.


next up previous
Next: Macro Modifydb for Increasing Dimensions Up: EMME/2 NEWS 13 October 1992 Previous: Macro Command Language Gets Even


Heinz Spiess, EMME/2 Support Center, Thu Jun 6 14:36:07 MET DST 1996