Omni Systems, Inc.

  

Mif2Go User's Guide, Version 55

  

Valid HTML 4.01!

 

Made with Mif2Go

28 Working with macros > 28.2 Accessing Mif2Go macro libraries > 28.2.3 Storing a macro definition in a separate file


28.2.3 Storing a macro definition in a separate file

You might want to use individual files for very large macros; or a separate file for a macro that you want to include in different configurations, much like a text inset.

A macro file is a text file that contains a nameless macro, with content that comprises the definition of the macro. A macro file can have any name and any extension; however, it makes sense to give the file a base name that is the name you would have given the same macro if included in a macro library file.

To invoke a macro in a macro file, specify a path to the macro file inside a $< ... > wrapper. The path must include at least one path separator (forward slash or backslash); this is what distinguishes a file macro invocation from a local or library macro invocation. A relative path is relative to the project directory. For example:

[ParaStyleCodeReplace]

ParaFmt = <$./mymacro.ini>

would cause Mif2Go to replace each instance of ParaFmt in the output with the content of mymacro.txt, located in the project directory.

A macro in a macro file can invoke other macros, including predefined macros, macros in other macro files, macros in library files, and macros in configuration files. Macros in macro files do not participate in the rules of precedence for chained macro libraries.

See also:

§28.2.4 Including macro definitions in your own macro library



28 Working with macros > 28.2 Accessing Mif2Go macro libraries > 28.2.3 Storing a macro definition in a separate file