Macros are a way to repeat model structures without retyping equations. To do this, the macro is first defined by writing equations, then invoked by calling them as you would call a function. In many cases, they can simplify the modeling process, but they are also dangerous in that they can allow dynamics to "creep into" a model. The implementation of macros in Vensim overcomes much of this hidden dynamics problem. Still, it is recommended that macros be used sparingly, if at all.
NOTE The macro definition must occur before the macro is referenced.
This is the only equation ordering rule in the Vensim modeling language. If you do not define a macro before you use it, you will receive a syntax error message.
You cannot nest macros. A macro definition cannot contain a reference to another macro. A macro call, on the other hand, can contain another macro call as well as function calls and other algebraic manipulations of variables.
While macros can use Vensim functions, they can't use functions that are themselves macros. These functions are: DELAY1, DELAY1I, DELAY3, DELAY3I, DELAYP, FORECAST, NPV, NPVE, SMOOTH, SMOOTH3, SMOOTH3I and TREND.