Sheltran - IF construct
Form:
IF <logical expression>
THEN
<statement>...
[ ELSEIF <logical expression>
THEN
<statement>... ]
[ ELSE
<statement>... ]
CIF
Notes:
- <logical expression> represents any valid FORTRAN logical
expression which can take a value .TRUE. or .FALSE. It need not be
surrounded by parentheses.
- ELSEIFs when present must precede any corresponding ELSE.
- The ELSE clause is optional.
- Instead of CIF ENDIF may also be used.
Actions:
When the IF or ELSEIF condition has the value .TRUE., the statements
following are executed and control is transferred to the statement
following the CIF.
When the value is .FALSE., control is passed to the next ELSEIF and this
<logical expression> is evaluated.
When the IF and all ELSEIF clauses have a value which is .FALSE.,
control is passed to the statement following the corresponding ELSE or
CIF.
Examples:
IF KEY.EQ.K1
THEN
KODE=1
ELSEIF KEY.EQ.K2
THEN
KODE=2
ELSE
KODE=-1
CIF
IF X.LT.0
THEN
X=999.0
CIF