Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper 5.2 . The Guide To CA-Clippe - <b>#ifndef</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 #ifndef
 Compile a section of code if an identifier is undefined
------------------------------------------------------------------------------
 Syntax

     #ifndef <identifier>
        <statements>...
     [#else]
        <statements>...
     #endif

 Arguments

     <identifier> is the name of a definition whose absence is being
     verified.

 Description

     #ifndef...#endif lets you perform conditional compilation by identifying
     a section of source code to compile if the specified <identifier> is
     undefined.

     The #else directive specifies the code to compile if <identifier> is
     defined.  The #endif terminates the conditional compilation block.

 Examples

     .  This code fragment is a general skeleton for conditional
        compilation with #ifndef:

        #define DEBUG
        .
        . <statements>
        .
        #ifndef DEBUG
           <optimized version of code>
        #else
           <debugging version of code>
        #endif

     .  This example compiles a section of code if a specific
        identifier is undefined.

        In DOS:

        C>CLIPPER Myfile

        In the program (.prg) file:

        #ifndef NODEBUG
           Assert(<some condition>)
        #endif

     .  This example overrides a default definition in the program
        (.prg) file using a manifest constant defined on the compiler command
        line with the /D option:

        In DOS:

        C>CLIPPER Myfile /DM_MARGIN=10

        In the program (.prg) file:

        #ifndef M_MARGIN
           #define M_MARGIN   15
        #endif

See Also: #define #ifdef

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson