The information in this article applies to:
SYMPTOMSIn 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:
CAUSEWhen 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. RESOLUTIONTo 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. STATUSMicrosoft 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. MORE INFORMATIONThe following code sample demonstrates this problem. If the user enters a CTRL+Z for the first READ statement, the application goes into an infinite loop. Sample Code #1
The following code example uses the WRITE statement to clear the
internal EOF flag before the application encounters any EOF condition.
When the user enters CTRL+Z, the application immediately resets the
EOF flag and the each READ statement in the application pauses for
input as expected.
Sample Code #2
Additional query words: 4.00 4.01 4.10 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. |