PPWIZARD Manual
[Bottom][Contents][Search][Prev]: EXAMPLE - TEST.D (source file)[Next]: Performance

PUSHPOPM.H - Save/Restore Macro Values

This is a small header file with support for the saving and restoring of macro values.

PUSHPOPM.H

;----------------------------------------------------------------------------
;     MODULE NAME:   PUSHPOPM.H
;
;         $Author:   Dennis  $
;       $Revision:   1.0  $
;           $Date:   15 Dec 2000 16:52:32  $
;        $Logfile:   C:/DBAREIS/Projects.PVCS/MultiOs/PPWIZARD/pushpopm.h.pvcs  $
;
;     DESCRIPTION:   This is a header file for saving and restoring MACRO
;                    values.
;
;                    This is useful where you need to "protect" the value
;                    from a header file you are including.  Fairly rare
;                    requirement, but handy when you need it.
;
;         EXAMPLE:   #define     XXXX    Some value
;                    <$MacroPush Macro='XXXX'>           ;;Save it
;                    #include    "File"                  ;;Header may change value
;                    <$MacroPop  Macro='XXXX'>           ;;Restore it
;----------------------------------------------------------------------------


;--- Only include once ----------------------------------
#ifndef VERSION_PUSHPOPM_H
   ;--- Define the version number of this header file ---
   #define   VERSION_PUSHPOPM_H    99.289

   ;--- Include nesting validation code -----------------
   #include "nestchk.h"
   <$NestingInit Id="PUSHPOPM" DESC="PUSHPOPM.H stack macro tag">

   ;--- Push Macro --------------------------------------
   #define MacroPush                                                    \
           <$NestingInc Id="PUSHPOPM">                                 -\
           #evaluate    ''          ^MacroPush = MacroGet('{$Macro}')^ -\
           #RexxVar     'MacroPush'  PUSH

   ;--- Pop Macro ---------------------------------------
   #define MacroPop                                  \
           <$NestingDec Id="PUSHPOPM">              -\
           #RexxVar     'MacroPush'  POP            -\
           #evaluate+   '{$Macro}'  'MacroPush'
#endif


[Top][Contents][Search][Prev]: EXAMPLE - TEST.D (source file)[Next]: Performance

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