PPWIZARD Manual
[Bottom][Contents][Search][Prev]: Expand All Parameters As Rexx Code[Next]: Special MACRO Replacement

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}".

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>"
    


[Top][Contents][Search][Prev]: Expand All Parameters As Rexx Code[Next]: Special MACRO Replacement

PPWIZARD Manual
My whole website and this manual itself was developed using PPWIZARD (free preprocessor written by Dennis Bareis)
Tuesday January 02 2001 at 7:37am