![]() | ![]() | ![]() | ![]() | ![]() |
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@>.
![]() | ![]() | ![]() | ![]() | ![]() |