PPWIZARD is a free preprocessor for HTML, REXX, Visual Basic or any text files.
[Bottom][Contents][Search][Prev]: {$??} - Expand All Parameters As Rexx Code[Next]: {<?x24>?PARMS} - Query: How many parameters were passed?
\ -> Macros -> Special Parameters -> {$?MACNAME} - Expand Macro Name

{$?MACNAME} - Expand Macro Name

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.

This section describes an advanced rarely used or required facility which allows you to write a macro that can determine the name of the macro being expanded (in the exact case used). This value can be obtained by using "{$?MACNAME}", its handy where the name of the macro is also part of the expanded text.

One example of where this could be handy is if you are marking the start of some sort of block for which you need an ending marker. If you would also like this block to be able to contain the ending marker (for example in documentation you may be showing someone how to do something) then you will need to perform a case sensitive search for the end block marker. The "<$eExample>" macro/tag (used in some of my headers) is an example of this sort of situation.

If you vary the case on the start of block macros and can determine this case you can create a end block marker from this value.

Example

Some test code follows:

#define    TestMacName      {$?MacName}
#define    TestMacNameUpper {$?MacName $$UPPER}

*** Macro name ***
MacroName = "<$TestMacName>"
MacroNAME = "<$TestMacNAME>"
MACRONAME = "<$TestMacNameUpper>"


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

[Top][Contents][Search][Prev]: {$??} - Expand All Parameters As Rexx Code[Next]: {$?PARMS} - Query: How many parameters were passed?


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