The information in this article applies to:
SYMPTOMSUnexpected or incorrect results may be generated while reading a file. CAUSE
When an error is encountered on a READ statement containing an ERR=label
field, the program correctly branches to the error label, and the file
pointer remains positioned after the point where the error occurred. Upon
reading the file again, if any data remains on that record, the READ
statement will fill variables with values from that record. Although this
practice may at times appear unintuitive, the ANSI standard is unclear
about where the file pointer should be positioned following an error
branching on the READ statement.
RESOLUTIONForce the file pointer to advance to the next record. STATUSMicrosoft has confirmed this to be a problem in Microsoft FORTRAN versions 5.0 and 5.1. This problem was corrected in FORTRAN PowerStation, version 1.0. MORE INFORMATIONThe following code can be used to reproduce the problem with a test.dat of 1 Sample Code #1
The above code produces the following results:
1The following code forces the file pointer to advance to the next record when an error is encountered during a READ statement: Sample Code #2
The output for the above code is as follows:
1 Additional query words: 5.00 5.10 buglist5.00 buglist5.10 fixlist1.00
Keywords : |
Last Reviewed: November 1, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |