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:
The macro contents refers to the parameters as a '#' followed by a decimal number which indicates its position (there can be any number of positional parameters).
Examples |
;--- 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@>