#ifdefined

Test if a constant has been defined.

#ifdefined  Constant

    < Precompiler directives and ProcScript statements >

#endif

Parameters

Constant—constant name

Description

The #ifdefined directive can be used to create a block of ProcScript statements and precompiler directives whenever the constant specified already exists.

The following example adds a debug statement to the ProcScript being compiled if the constant <DEBUGGING> is defined as 1:

#ifdefined DEBUGGING
   #if (<DEBUGGING>=1)
      debug
   #endif
#endif
  • If the constant <DEBUGGING> is not defined, no further code is generated.
  • If the constant <DEBUGGING> is defined as 0, the #if directive is generated as follows:
    #if (1=0)
       debug
    #endif

    In this case, no ProcScript is generated.

  • If the constant <DEBUGGING> is defined as 1, the #if directive is generated as follows:
    #if (1=1)
       debug
    #endif

    In this case, the following ProcScript statement is compiled:

    debug

Related Topics