PPWIZARD is a free preprocessor for HTML, REXX, Visual Basic or any text files.
[Bottom][Contents][Search][Prev]: Positional Parameters (not named)[Next]: Multi Line Macros With Logic
\ -> Macros -> Using Standard Definitions + Using REXX Logic

Using Standard Definitions + Using REXX Logic

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.

The following example uses the "#evaluate" command and the "Standard Definition" of "<?OutputFile>" as well as demonstrating the use of using rexx code to include logic.

;--- Capture some HTML information ------------------------------------------
#evaluate ShortNameHtml            "FilePart('name', '<?OutputFile>')"
#evaluate ShortNameHtmlLowerCase   "ToLowerCase('<$ShortNameHtml>')"

The above defined two macros, the first is the short name of the output file (no path or drive attached) and the second is the same short name but all lower case.

A "Problem"

Notice that the first parameter to the rexx translate function above is surrounded by single quotes, we could safely do this only because we know that a filename can't contain single quotes! You need to be careful with your use of quotes etc as the macro replacement simply places the correct text where requested. We could have used the PPWIZARD "MacroGet" function if we were not sure about the quote situation as demonstrated below:

;--- Capture some HTML information ------------------------------------------
#evaluate ShortNameHtmlLowerCase   "ToLowerCase(MacroGet('ShortNameHtml'))"

There is another (probably better way) of handling the quote 'problem' as in:

;--- Capture some HTML information ------------------------------------------
#evaluate ShortNameHtmlLowerCase   "ToLowerCase('<$ShortNameHtml $$SQX2>')"


email me  any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Search][Prev]: Positional Parameters (not named)[Next]: Multi Line Macros With Logic


PPWIZARD Manual
My whole website and this manual itself was developed using PPWIZARD (free preprocessor written by Dennis Bareis)
Sunday November 05 2017 at 10:00am