Omni Systems, Inc.

  

Mif2Go User's Guide, Version 55

  

Valid HTML 4.01!

 

Made with Mif2Go

28 Working with macros > 28.7 Passing a parameter to a macro


28.7 Passing a parameter to a macro

You can pass a single parameter to a macro by enclosing the value of the parameter in parentheses. Mif2Go evaluates the parameter as an expression, and the result of the expression is captured in predefined macro variable $$_macroparam. You can reference $$_macroparam in the same macro, and if you need to keep it around, assign its value to another macro variable.

For example, suppose you have a pair of before-and-after macros that surround the body of content intended to be rendered as a note:

[NoteBefore]

<p class="notehead"><$$_macroparam></p>

<p class="notebody">

You could change the heading to reflect the severity level of the note by invoking the macro like this:

<$NoteBefore("Warning")>

or like this:

<$NoteBefore("Note")>



28 Working with macros > 28.7 Passing a parameter to a macro