FIX: Record Not Advanced If Branching to ERR= on READ (75757)
The information in this article applies to:
- Microsoft FORTRAN Compiler for MS-DOS 5.0
- Microsoft FORTRAN Compiler for MS-DOS 5.1
- Microsoft FORTRAN compiler for OS/2 5.0
- Microsoft FORTRAN compiler for OS/2 5.1
This article was previously published under Q75757 SYMPTOMS
Unexpected 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.
However, if no variables remain on a record in which an error is branched
to upon a prior READ statement, when reading from the file again, the next
variable is filled with a zero. See the sample code for more information.
RESOLUTION
Force the file pointer to advance to the next record.
STATUS
Microsoft 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.
Modification Type: | Major | Last Reviewed: | 12/1/2003 |
---|
Keywords: | kbfix KB75757 |
---|
|