next up previous
Next: ASSIGN Statement Up: Obsolescent Features Previous: Obsolescent Features

Arithmetic IF Statement

It is a three way branch statement of the form,

 
 IF( tex2html_wrap_inline21419  expression  tex2html_wrap_inline21421 )  tex2html_wrap_inline21419  label1  tex2html_wrap_inline21421 , tex2html_wrap_inline21419  label2  tex2html_wrap_inline21421 , tex2html_wrap_inline21419  label3  tex2html_wrap_inline21421  

Here tex2html_wrap_inline21419  expression tex2html_wrap_inline21421 is any expression producing a result of type INTEGER, REAL or DOUBLE PRECISION, and the three labels are statement labels of executable statements. If the value of the expression is negative, execution transfers to the statement labelled tex2html_wrap_inline21419  label1 tex2html_wrap_inline21421 . If the expression is zero, transfer is to the statement labelled tex2html_wrap_inline21419  label2 tex2html_wrap_inline21421 , and a positive result causes transfer to tex2html_wrap_inline21419  label3 tex2html_wrap_inline21421 . The same label can be repeated.

This relic of the original Fortran has been redundant since the early 1960s when the logical IF and computed GOTO were introduced and it should be replaced by an equivalent CASE or IF construct.


next up previous
Next: ASSIGN Statement Up: Obsolescent Features Previous: Obsolescent Features

Adam Marshall ©University of Liverpool, 1996
Wed Oct 9 17:57:29 BST 1996