PPWIZARD is a free preprocessor for HTML, REXX, Visual Basic or any text files.
Positional Parameters (not named) |
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.
In some cases (especially with simple one parameter macros) you may
simply wish to supply a value without bothering to name it.
For example one way to implement a HTML comment might be:
;--- Define a macro (takes a parameter called "Text") ----
#define COMMENT <!-- {$Text} -->
;--- Use the above macro ---
<$COMMENT Text="This will become a html comment">
As you can see from the above we had to use "Text=" even though that
is all the parameter could be (at least correctly), lets do this
again but this time using a positional parameter:
;--- Define a macro (takes a single positional parameter) ----
#define COMMENT <!-- {$#1} -->
;--- Use the above macro ---
<$COMMENT "This will become a html comment">
The fact that PPWIZARD supports
keyword parameters complicates
things as a parameter without a value can easily be mistaken for a keyword
so the rules are:
- Starts with a 'QUOTE'
Something that starts with a "quote" is a positional parameter,
the quote chars include single and double quotes .
- Starts with a '=
If you can't quote the value with one of the above listed
"quotes", then you can begin with an equal.
The value following is a normal
quoted value.
The macro contents refers to the parameters as a '#' followed
by a decimal number which indicates it's position (there can be any number
of positional parameters).
<pre>
<a href="commenting.htm" TITLE="Line comment">;</a>--- Use the above macro ---
<$COMMENT "Using double quotes">
<$COMMENT 'Using single quotes'>
<$COMMENT =@If all normal "quote" chars were (or could be) in this string@>
</pre>
<a name="BOTTOM" id="BOTTOM"></a>
<p><hr><center><table border="3" cellspacing="3" cellpadding="3"><tr><td><a href="#TOP"><img src="top.gif" border=0 WIDTH=30 HEIGHT=30 ALT="[Top]"></a><td><a href="ppwizard.htm"><img src="contents.gif" border=0 WIDTH=63 HEIGHT=37 ALT="[Contents]"></a><td><A HREF="http://intra.whatUseek.com/searchbox.go?crid=59dd87052cd4d987"><IMG SRC="search.gif" BORDER=0 WIDTH=59 HEIGHT=40 ALT="[Search]"></A><td><a href="macroswithoutvalues.htm"><img src="prev.gif" border=0 WIDTH=49 HEIGHT=31 ALT="[Prev]: Macro Parameters without values (Keyword)"></a><td><a href="macroswithrexx.htm"><img src="next.gif" border=0 WIDTH=49 HEIGHT=31 ALT="[Next]: Using Standard Definitions + Using REXX Logic"></a></tr></table></center><BR><CENTER>PPWIZARD Manual<BR><A HREF="../ppwizard.htm"><IMG SRC="madewppw.jpg" VSPACE=5 ALIGN=middle WIDTH=120 HEIGHT=35 BORDER=0 ALT="My whole website and this manual itself was developed using PPWIZARD (free preprocessor written by Dennis Bareis)"></A><BR>Thursday January 17 2002 at 6:27pm</CENTER></body></html>