FIX: READ Does Not Pause or F6501 Error After CTRL+Z (81326)
The information in this article applies to:
- Microsoft FORTRAN Compiler for MS-DOS 4.0
- Microsoft FORTRAN Compiler for MS-DOS 4.01
- Microsoft FORTRAN Compiler for MS-DOS 4.1
- Microsoft FORTRAN Compiler for MS-DOS 5.0
- Microsoft FORTRAN Compiler for MS-DOS 5.1
This article was previously published under Q81326 SYMPTOMS
In an application compiled with Microsoft FORTRAN, when the user responds
to a keyboard READ statement with a CTRL+Z character, subsequent READ
statements do not pause for input or the run-time library generates the
following message:
run-time error F6501: READ(CON)
- end of file encountered
CAUSE
When the user enters a CTRL+Z character to signify the end-of-file (EOF)
condition, the run-time library sets an internal variable to indicate that
the EOF has occurred. This variable remains set until the application
executes a PRINT or WRITE statement. When the READ statement includes the
END modifier and the internal EOF variable is set, execution branches
immediately to the statement specified in the END modifier. When the READ
statement does not include the END modifier and the internal EOF variable
is set, the F6501 error occurs.
RESOLUTION
To address this problem, use the PRINT or WRITE statement to send
information to the screen and to reset the internal EOF flag prior to each
READ that may receive the CTRL+Z. Using the graphics function OUTTEXT to
send output to the screen does not clear the internal EOF flag.
STATUS
Microsoft has confirmed this to be a problem in FORTRAN versions 4.0, 4.01,
4.1, 5.0 and 5.1 for MS-DOS. This problem was corrected in FORTRAN
PowerStation, version 1.0.
Modification Type: | Major | Last Reviewed: | 9/30/2003 |
---|
Keywords: | kbfix KB81326 |
---|
|