D
Dan Pop
In said:I have never programmed in Fortran, but I think it was about the same
situation with the Fortran version Dan Pop grew up with.
Nope, FORTRAN IV was much better than BASIC and the "new" logical IF
statements were a great improvement over FORTRAN II's arithmetic IF
statements (which were gotos with 3 destinations).
Each program unit (main unit, functions and subroutines) had its own
local variables and it could be made to "see" only the global variables
it needed to see.
Its main drawbacks, that survived until F90, were the fixed-form line
format with purely numeric labels (characters beyond column 72 were
silently ignored, to provide additional fun during debugging) and blanks
being *completely* ignored in the statement field (starting in column 7),
except inside "string" literals. Hence the (in)famous typo:
DO 5 I = 1. 5
(the period was supposed to be a comma) that led to the statement being
parsed as:
DO5I = 1.5
i.e. a loop was replaced by an assignment to a bogus variable and the body
of the loop was executed once instead of 5 times. This happened in a NASA
program, but the consequences were minimal (a certain entity was evaluated
with less precision than intended).
Dan