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:
EMME2\MACROS
directory (for macros that are part of
the official software distribution), using extension .MAC,E:\NTPROJET\MACROS
(note the
trailing ``\
'' at the end of the SET command).