Build a section of code if a constant is FALSE, 0, or not defined.
|<idConstant>||The name of a constant whose absence is being verified.|
#ifndef...#endif lets you perform a conditional build by identifying a section of source code to include if a specified constant is defined as FALSE or 0 or is not defined. The #else statement specifies the code to include if the #ifndef condition fails, and the #endif terminates the conditional build block.
Note: You can use #ifndef with compiler entities other than constants, such as functions and globals. In these cases, the statement tests for existence only, and does not look at the value of the entity.
This code fragment is a general skeleton for a conditional build with #ifndef. Since the constant lDebug is set to FALSE, the code between the #ifndef and #else statements will be built, and the code between the #else and #endif statements will be ignored:
DEFINE lDebug := FALSE
<Optimized version OF code>...
<Debugging version OF code>...
Changing the DEFINE statement as follows will build the code between the #else and #endif statements instead.
DEFINE lDebug := TRUE