PPWIZARD is a free preprocessor for HTML, REXX, Visual Basic or any text files.
[Bottom][Contents][Search][Prev]: Simplest Macros[Next]: Macros With Mandatory Parameters
\ -> Macros -> Multi Line Macros

Multi Line Macros

The subject of macros is reasonably complex (but well worth learning) please ensure you have at least read the macro introduction before reading this section.

Sometimes a macro contains quite a bit of text and to make it easier you might wish to spread the definition over a number of lines. This will also allow you to add comments and spacing to allow it to be easy to read.

When PPWIZARD sees a multi line macro (formatted in a similar manner to the example below - break after macro name) it breaks it up into multiple lines so that any imbedded PPWIZARD commands will get executed.

You need to be careful to correctly begin a multiline macro, the first line must be of the form:

#define TheMacroName  \

The following is an example of an invalid definition (as it does not ensure a space follows the "TheMacroName" parameter as is required by the #define command). :

#define TheMacroName  -\

Also check out the #( command as it is also very useful for creating multiline macros. To define blocks of rexx code use the #DefineRexx command.

Note that for ppwizard commands (within a #define) to be executed when the macro is expanded the commands must be on their own line.

;--- Define the macro -------------------------------------
#define FeedBackParagraphs                                        \
        ;---- First paragraph -----------------------------       \
        <P>I have put a lot of work into this product and         \
           believe it to be of a very high standard.              \
           I always appreciate feedback which indicates which     \
           features you use and like and which you don't          \
           like.                                                  \
        ;---- Second paragraph ----------------------------       \
        <P>Please <A HREF="mailto:<$MyEmailAddress>">email me</A> \
           with tour comments.

;--- Use the macro ----------------------------------------

Notice that the expanded "<$FeedBackParagraphs>" will refer to our previously defined "MyEmailAddress" macro. It is perfectly legal for a macro definition to refer to any number of other definitions.

email me  any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Search][Prev]: Simplest Macros[Next]: Macros With Mandatory Parameters

My whole website and this manual itself was developed using PPWIZARD (free preprocessor written by Dennis Bareis)
Sunday November 05 2017 at 10:00am