#if

Conditionally generate ProcScript, depending on the results of the speified expressions.

#if (Expression_1)

... ProcScript statements and precompiler directives

{#elseif (Expression_2)

... ProcScript statements and precompiler directives ...

... }

{#else

... ProcScript statements and precompiler directives ... }

#endif

Parameters

Expression—logical expression that evaluates to true or false

Description

The #if directive conditionally generates ProcScript based on the results of logical expressions. Each Expression is evaluated in sequence, beginning with the one with the #if statement.

The Expression can contain one or more of the relational operators, = (equal to) or != (not equal to), in combination with the logical operators & (and), and | (or). Parenthesis can be used to create nested expressions.

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