Sheltran - IF construct


Form:

      IF <logical expression>
      THEN
         <statement>... 
    [ ELSEIF <logical expression>
      THEN
         <statement>...      ] 
    [ ELSE
         <statement>...      ] 
      CIF

Notes:

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

Programming GIPSY