<<

Contents

Search

>>

 

IF

 

 

Instruction

 

 

Syntax:

IF <Condition>

THEN ... Instructions ...

[ELSE ... Instructions ...]

ENDIF

 

<Condition> = <LOG-EXPRESSION>

 

Meaning:

If the logical expression <Condition> is true, the instructions after THEN are executed. If the expression is false, the expressions after ELSE (if existent) are executed. IF-THEN-ELSE­-ENDIF-instructions can be nested any number of times.

 

Parameter:

Condition

Logical expression

 

Sample:

IF A = 1

THEN PRINT "A = 1"

ELSE PRINT "A <> 1"

ENDIF

 

See also:

CASE

WHILE