.IFT, .IFF, .IFTF

Control conditional processing

WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX
VSupported on OpenVMS
directive
   [. . .
source_1
   . . .]
[.IFT
   . . .
[source_2
   . . .]]
[.IFF
   . . .
[source_3
   . . .]]
[.IFTF
   . . .
[source_4
   . . . ]]
.ENDC

Arguments

directive

The .IF, .IFDEF, or .IFNDEF compiler directive and the specified data element.

source_1

(optional) One or more lines of source code.

source_2

(optional) One or more lines of source code.

source_3

(optional) One or more lines of source code.

source_4

(optional) One or more lines of source code.

Discussion

The .IFT, .IFF, and .IFTF compilation control directives are used within the .IF, .IFDEF, and .IFNDEF directives to control conditional processing. You can use any number of .IFT, .IFF, .IFTF directives within a conditional block, in any order.

The .IFT, .IFF, and .IFTF directives perform processing based on the following conditions:

.IFT

Instructs the compiler to process the statements that follow if the original condition of the current conditional block is true.

.IFF

Instructs the compiler to process the statements that follow if the original condition of the current conditional block is false.

.IFTF

Instructs the compiler to process the statements that follow regardless of whether the original condition of the current conditional block is true or false.

The source_1 lines of code are compiled only if the specified conditional directive (.IF, .IFDEF, or .IFNDEF) is true. If the .IFT directive is present, the source_2 lines of code are also compiled only if the specified conditional directive (.IF, .IFDEF, or .IFNDEF) is true. If the .IFF directive is present, the source_3 lines of code are compiled only if the specified conditional directive (.IF, .IFDEF, or .IFNDEF) is false. If the .IFTF directive is present, the source_4 lines are compiled regardless of whether the specified conditional directive is true or false.

You can use one or more of the .ELSE, .IFT, .IFF, and .IFTF directives within an .IF, .IFDEF, or .IFNDEF conditional block of code. The .ELSE and the .IFF directives perform equivalent functions.

See .IF-.ELSE-.ENDC, ­.IFDEF-.ELSE-.ENDC, and .IFNDEF-.ELSE-.ENDC for more information about specifying a conditional block of code.

Examples

In the following example, the .ELSE, .IFT, .IFF, and .IFTF directives are all processed according to the result of the original condition of the current conditional block (in this case, .ifdef unix).

.define UNIX
    .
    .
    .
record
.ifdef unix                             ;This code will be compiled.
    sys  ,a,            "UNIX"
.else
.ifdef openvms                          ;This code won't be compiled.
    sys  ,a,            "OpenVMS"
.endc
.ift                                    ;This code will be compiled.
    buf  ,a1024
.iff                                    ;This code won't be compiled.
    buf  ,a512
.iftf                                   ;This code will be compiled.
    name ,a40
.endc

Since UNIX is defined, the following code will be compiled:

record
    sys  ,a,            "UNIX"
    buf  ,a1024
    name ,a40