The information in this article applies to:
SYMPTOMSA program compiled with Microsoft FORTRAN, that uses an implied DO-loop in a READ statement that has the END=label or ERR=label directive, will not branch to the specified label if the loop reads past the end of the file. The implied DO-loop will continue to completion with no error and without branching to the end label. The elements of the array that cannot be read from the file are filled with zeros. CAUSEThere is no way to trap the end-of-file condition in the middle of reading an implied DO-loop. RESOLUTIONTo obtain predictable results when using implied DO-loops, ensure that there is sufficient data in each record to fill all the elements of the array that is being read into. The END=label specifier cannot be relied upon to trap insufficient data on the final record. STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available. MORE INFORMATION
This is not a problem with the run-time handling of the END= or ERR=
directives in READ statements. When an implied DO-loop reads past the
amount of data on a record, the default run-time end-of-record
handling fills the remaining array elements with zeros. This occurs
even on the last record in a file. The end of file is not encountered
when an implied DO-loop runs out of data on the final record in a
file. The end-of-record condition is met first, and the remainder of
the array is filled with zeros without allowing the end of file to be
read. If another READ statement occurred at this point, the end of
file would be encountered.
Additional query words: 1.00 4.00 5.00 5.10
Keywords : kbFortranPS kbLangFortran |
Last Reviewed: November 2, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |