Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - #ifndef conditional compilation start (undefined identifier) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 #ifndef             Conditional compilation start (undefined identifier)
------------------------------------------------------------------------------
 Syntax
   #ifndef <macroname>
      <statements>
   #else
      <statements>
   #endif

 Arguments
   <macroname> is a macro identifier.
   <statements> are source instructions for the compiler.

 Description
   The #ifndef directive starts a conditional compilation block.
   It controls whether or not the section of code between the #ifndef
   directive and the #endif directive is compiled.

   The #ifndef construct will compile the statements between it and the
   #endif (or #else) only if the macro identifer has not been defined. Then,
   if there is an #else directive, its statements will be compiled only if
   the identifer has been defined.

   Conditional compilation blocks may be nested.

 Example
   #define EXAMPLE_DIRECTIV
   #include example.hdr

   //#define EXPIRE // uncomment for version that expires
   
   proc Test_854
   ? "Program started..."
   
   #ifdef EXPIRE
      ? "Demo version will now quit"
      wait
      quit
   #endif
   
   #ifndef EXPIRE
      ? "Program running..."
   #endif
   
   ? "Program end"
   endproc

   proc main
   Test_854()
   endproc

See Also: #else #ifdef

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