Omni Systems, Inc.

  

Mif2Go User's Guide, Version 33u53

  

Valid HTML 4.01!

 

Made with Mif2Go

27 Working with Mif2Go macros > 27.1 Defining and invoking macros > 27.1.6 Storing a macro definition in a separate file


27.1.6 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 configuration file or 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 folder. For example:

[StyleCodeReplace]

ParaFmt = <$./mymacro.txt>

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

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:

§27.1.7 Including macro definitions in a library



27 Working with Mif2Go macros > 27.1 Defining and invoking macros > 27.1.6 Storing a macro definition in a separate file