synch
- 84
- 11
[ Historical program question - I am not asking advice about current versions ]
About reading a file with an arbitrary number of records in say Fortran 66 :
Typically a DO loop was used to repeat a READ statement.
There was an option in a READ statement eg END = nnn, with nnn being the statement ID
to branch to when the end of the file was reached. I think there was also an
EXIT statement which would wind up the current DO loop, so I guess that would be
the typical statement to branch to, in that situation.
The question is, if the loop finishes and terminates naturally before the end of the file is reached,
presumably the EXIT statement would still be present and so cause problems unless it was bypassed.
Was it possible to conditionally EXIT only if there was a current end-of-file condition ?
[ I know f77 and later had better methods eg "while" constructs and so on, the question is not about those.]
About reading a file with an arbitrary number of records in say Fortran 66 :
Typically a DO loop was used to repeat a READ statement.
There was an option in a READ statement eg END = nnn, with nnn being the statement ID
to branch to when the end of the file was reached. I think there was also an
EXIT statement which would wind up the current DO loop, so I guess that would be
the typical statement to branch to, in that situation.
The question is, if the loop finishes and terminates naturally before the end of the file is reached,
presumably the EXIT statement would still be present and so cause problems unless it was bypassed.
Was it possible to conditionally EXIT only if there was a current end-of-file condition ?
[ I know f77 and later had better methods eg "while" constructs and so on, the question is not about those.]