INCLAN: if

From CYANA Wiki
Revision as of 09:47, 17 August 2009 by Masayo (talk | contribs) (→‎Synopsis)
Jump to navigation Jump to search

Synopsis

if (condition) statement

or

if (condition) then
.
.
else if (condition) then
.
.
else
.
.
end if

Description

The "if" statement allows for Fortran-77 style logical or block if statements. A logical "if" statement must not end with the word "then".

Examples

i=–56
if (i.lt.0) print "$i is negative."
–56 is negative.
if (mod(i,2).eq.1) then
  print "$i is an odd number."
else if (def(’x’) .and. exist(’y’)) then
  print "x is defined, and y exists."
else if (s.eq.’ ’) then
  print "The variable s is blank."
end if