home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / pushpopm.zip / pushpopm.h
Text File  |  1999-10-26  |  2KB  |  44 lines

  1. ;----------------------------------------------------------------------------
  2. ;     MODULE NAME:   PUSHPOPM.H
  3. ;
  4. ;         $Author:   Dennis_Bareis  $
  5. ;       $Revision:   1.1  $
  6. ;           $Date:   26 Oct 1999 17:19:16  $
  7. ;        $Logfile:   E:/DB/PVCS.IT/OS2/PPWIZARD/PUSHPOPM.H_V  $
  8. ;
  9. ;     DESCRIPTION:   This is a header file for saving and restoring MACRO
  10. ;                    values.
  11. ;
  12. ;                    This is useful where you need to "protect" the value
  13. ;                    from a header file you are including.  Fairly rare
  14. ;                    requirement, but handy when you need it.
  15. ;
  16. ;         EXAMPLE:   #define     XXXX    Some value
  17. ;                    <$MacroPush Macro='XXXX'>           ;;Save it
  18. ;                    #include    "File"                  ;;Header may change value
  19. ;                    <$MacroPop  Macro='XXXX'>           ;;Restore it
  20. ;----------------------------------------------------------------------------
  21.  
  22.  
  23. ;--- Only include once ----------------------------------
  24. #ifndef VERSION_PUSHPOPM_H
  25.    ;--- Define the version number of this header file ---
  26.    #define   VERSION_PUSHPOPM_H    99.289
  27.  
  28.    ;--- Include nesting validation code -----------------
  29.    #include "nestchk.h"
  30.    <$NestingInit Id="PUSHPOPM" DESC="PUSHPOPM.H stack macro tag">
  31.  
  32.    ;--- Push Macro --------------------------------------
  33.    #define MacroPush                                                    \
  34.            <$NestingInc Id="PUSHPOPM">                                 -\
  35.            #evaluate    ''          ^MacroPush = GetMacro('{$Macro}')^ -\
  36.            #RexxVar     'MacroPush'  PUSH
  37.  
  38.    ;--- Pop Macro ---------------------------------------
  39.    #define MacroPop                                  \
  40.            <$NestingDec Id="PUSHPOPM">              -\
  41.            #RexxVar     'MacroPush'  POP            -\
  42.            #evaluate+   '{$Macro}'  'MacroPush'
  43. #endif
  44.