IF


Next: INT Up: COD Command Summary Previous: I

IF

If the condition is true, execute statements up to the corresponding ELSE or THEN statement. If the condition is false, pass control to the first statement following the ELSE if it exists, otherwise to the first statement following the THEN. IF structures can be nested. This word can only be used in colon definitions.

Example:

 X 1 <
 IF
  ! do these statements if X<1
 THEN

 X 1 >
 IF
  ! do these statements if X>1
 ELSE
  ! do these statements if X<=1
 THEN



Web Page Maintained by: Dr. Lawrence E. Brown elwin@redshift.gsfc.nasa.gov