[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 #undef
 Remove a #define macro definition
------------------------------------------------------------------------------
 Syntax

     #undef <identifier>

 Arguments

     <identifier> is the name of the manifest constant or pseudofunction
     to remove.

 Description

     #undef removes an identifier defined with the #define directive. After
     an #undef, the specified identifier becomes undefined.  Use #undef to
     remove an identifier before you redefine it with #define, preventing the
     compiler warning that occurs when an existing identifier is redefined.
     Also, use #undef to make conditional compilation specific to certain
     sections of a program.

 Examples

     .  To define and then undefine a manifest constant and a
        pseudofunction:

        #define K_ESC  27
        #define MAX(x, y)   IF(x > y, x, y)
        .
        . <statements>
        .
        #undef K_ESC
        #undef MAX

     .  To use #undef to undefine an identifier before redefining it:

        #define DEBUG
        .
        . <statements>
        .
        #undef DEBUG
        #define DEBUG   .T.

     .  To undefine an identifier if it exists, and otherwise define
        it for later portions of the program file:

        #ifdef TEST
           #undef TEST
        #else
           #define TEST
        #endif


See Also: #define #ifdef #ifndef
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson