2.7  Declare Macro

A Macro declares an expression or comparison that, when referenced, is lexically subtituted in place of the reference. You can declare a Macro with either as simple name or a name followed by a parameter list enclosed in parenthesis. An empty parameter list is not permitted. Macros can be declared as a Local within procedures, a Global within a class, or as a field within a structure.

You can reference a Macro with no parameters to substitute oft used expressions and conditions into program text. When an expression is substituted into text it is implicitly wrapped in parenethesis. This preserves the operator precedence of the Macro expression.


A Macro expression or comparison may contain references to variables, Micros, other Macros, constants, or quotes. Any named references must be within the scope where the Macro is instantiated.

Marcos are lexically substituted so they do not have a type. Types for Macro expressions are assigned within the code where they are used. Consequently they can contain operators and variables of any type. Note that Macro s can not be defined as a compound condition that use the 'and' and 'or' operators.

Macro parameters allow you to invoke them with elements specific to the context in which they are invoked. An argument can be an expression that may also reference other Macros or Micros.


The name of a Macro Parameter starts with a lead dot to distinguish it from other symbols. If you are using enumerated literals when declaring the Macro expression be sure to choose an argument name that does not conflict.

The argument expression is first substituted into the Macro expression. Then the resulting Macro is subsequently substituted into the text where the macro was invoked. If a macro argument is an expression, it will only be evaluated once; even if it is used several times within in the Macro expression.

The Default value can also be an expression. When an argument is left blank then the default expression is used. All blank arguments must have a corresponding Macro parameter with a default. Typically you will want to declare defaults on parameters at the end of the list.

Declare Micro

Dual Platform Path