++IFDEF, ++IFNDEF, ++ELIFDEF

These directives may be used to conditionally compile sections of code based on whether a specified symbol or structure name has been defined, via DEFINE, Compiler Symbol Definitions, or DEFSTRUCT.

One typical use is to compile separate bits of code based on a prior symbol definition, for example:

++ifdef VER_WIN

   MAP1 TEMPDIR,"c:\temp"

++elifdef VER_UNIX

   MAP1 TEMPDIR,"/tmp"

++else

   MAP TEMPDIR,"%TEMP%"

++endif

 

In the above example, the symbols VER_WIN or VER_UNIX might have been defined via a DEFINE statement or via the /C switch passed to the compiler.

Another typical use is to avoid redundantly processing a ++include module that may have already been compiled. See Using Conditionals to Avoid Duplicate Includes.