XL Fortran for AIX 8.1

Language Reference

IF (Block)

Purpose

The block IF statement is the first statement in an IF construct.

Format



>>-+----------------------+------------------------------------->
   '-IF_construct_name--:-'
 
>--IF--(--scalar_logical_expr--)--THEN-------------------------><
 
 

IF_construct_name
Is a name that identifies the IF construct.

Rules

The block IF statement evaluates a logical expression and executes at most one of the blocks contained within the IF construct.

If the IF_construct_name is specified, it must appear on the END IF statement, and optionally on any ELSE IF or ELSE statements in the IF construct.

Examples

WHICHC: IF (CMD .EQ. 'RETRY') THEN
     IF (LIMIT .GT. FIVE) THEN          ! Nested IF constructs
         
  ·
  ·
  ·
CALL STOP ELSE CALL RETRY END IF ELSE IF (CMD .EQ. 'STOP') THEN WHICHC CALL STOP ELSE IF (CMD .EQ. 'ABORT') THEN CALL ABORT ELSE WHICHC GO TO 100 END IF WHICHC

Related Information


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]