Introduction MTB Statements File System Compiler Applications Reference Guide Index

Overview Creating MTB Source Programs Compiling MTB Programs Compiler Directives Special Characters

.ELSE directive

Syntax: .ELSE
Discussion: The .ELSE statement is a compiler directive. As such, it causes an action to occur when the program is compiled, not when the program is executed. The .ELSE directive can appear anywhere in an MTB source program.

The .ELSE directive provides for the conditional compilation of alternative code segments, as follows:

.IF symbolic-constant

MTB code segment 1

.ELSE

MTB code segment 2

.ENDIF

The .IF directive tests the value of the symbolic constant. If it contains a non-zero value, the first code segment is compiled (and the second segment is not). If the symbolic constant contains a value of 0 or is not SET, only the second code segment is compiled.

Example:
  SET ABC=0       ! symbolic constant = 0
                  ! therefore, compile code segment 2
  .IF ABC
  (segment 1)

  .ELSE
  (segment 2)

  .ENDIF