PPWIZARD Manual
[Bottom][Contents][Search][Prev]: Macros With Mandatory Parameters[Next]: Macro Parameters without values

Macros With Optional 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.

Also note that you can create a macro which accepts optional parameters. The "VISIBLE" parameter we have been using up to now is manditory (required), if not supplied the preprocessor will inform you of this fact and stop. To make a parameter optional you assign at least the first occurance of the parameter a default value. You can give each occurance a default value (which may be different), and the last specified default value is remembered for subsequent occurances where a default value is required but not specified. For example to change the email macro to use my email address as the default but allow the specification of alternative addresses I could do the following:

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

You could then say:

    <P>If you have any questions or suggestions for improvements please feel free to
    <$EmailMeLink VISIBLE=@email me@>, I have another
    <$EmailMeLink VISIBLE=@email address@ EMAIL=$db1@anz.com$> which
    you might like to try.
    


[Top][Contents][Search][Prev]: Macros With Mandatory Parameters[Next]: Macro Parameters without values

PPWIZARD Manual
My whole website and this manual itself was developed using PPWIZARD (free preprocessor written by Dennis Bareis)
Wednesday October 04 2000 at 5:05pm