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

Macros With Mandatory Parameters

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.

Back to my previously defined email macro, whenever I use it I still have to duplicate a lot of HTML tagging. What we could do is create an email macro which accepts the text or graphic that the user would click to email me, as below:

    #define EmailMeLink  <A HREF="mailto:db0@anz.com">{$VISIBLE}</A>
    

The above macro accepts a single parameter which must be supplied when the macro is used. The parameter's name is "VISIBLE". The macro refers to a parameter by placing '{$' at the start and '}' at the end of the macro parameters name. To use this macro we could say:

    <P>If you have any questions or suggestions for improvements please feel free to
    <$EmailMeLink VISIBLE="email me">.
    

Note that when you supply the value for a macros parameter you can use virtually any character as a quote not just single or double quotes, for example you could say:

    <P>If you have any questions or suggestions for improvements please feel free to
    <$EmailMeLink VISIBLE=@email me@>.
    


[Top][Contents][Search][Prev]: Multi Line Macros[Next]: Macros With Optional Parameters

PPWIZARD Manual
My whole website and this manual itself was developed using PPWIZARD (free preprocessor written by Dennis Bareis)
Thursday January 17 2002 at 6:27pm