Macros are collections of text and/or commands and would have to be one of the most important and most used features of this preprocessor.
Macros can be created using one of the following methods:
The simplest types of macro simply allows you to define text which
you will use over and over again.
You will want to specify it in one place so that if it ever changes you
won't need to hunt up all occurances.
The following example shows an email address being defined (this would
normally be done in a central place and be accessed with
#include):
#define MyEmailAddress dbareis@labyrinth.net.au
Now that we have defined the email address (once as per example above),
in all the html pages that required it we could refer to it as in:
<P>If you have any questions or suggestions for improvements please feel free to
<A HREF="mailto:<$MyEmailAddress>">email me</A>.
There are also a number of "Standard Macros" which always exist, including the following specialised forms:
All normal macros are replaced before standard macros. The "<?xXX>" form is never replaced until just before the line is to be written to the output file.
The following sections provide more details about macros (please read in order):
A macro's name (or parameter) can be very long and can contain nearly any character (space and end of macro replacement character are the main exceptions). You will be told if a macro name is invalid when you try to define it. The maximum length of a macro will be approximately 100 characters in OS/2 rexx and unlimited with the regina interpreter.
The name of a macro (and it's parameters) are normally case insensitive, however you can make them case sensitive by using the CsReplacement option. When this option is not used all macros and parameters are converted to upper case.