BUG: PEEKCHARQQ Incorrectly Returning .TRUE.Last reviewed: July 13, 1995Article ID: Q111001 |
The information in this article applies to:
SYMPTOMSIn a FORTRAN PowerStation application, PEEKCHARQQ may return a value of .TRUE. even though there is no keystroke waiting in the keyboard buffer.
CAUSEIf GETCHARQQ is not called at least once in the program before calling PEEKCHARQQ, a call to PEEKCHARQQ will always return .TRUE.. Even after first calling GETCHARQQ, PEEKCHARQQ, when called repeatedly, may incorrectly return that a keystroke is available.
STATUSMicrosoft has confirmed this to be a problem in FORTRAN PowerStation 32 for Windows NT, version 1.0. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATIONThe sample program below should print stars until a key is pressed. However, after entering a keystroke to start the PEEKCHARQQ loop, stars will stop printing if no key is pressed. If the call to GETCHARQQ is removed, only one star will print.
Sample CodeC Compile options needed: none C
include 'flib.fi' include 'flib.fd' character*1 key logical pressed/.false./ write(*,*) 'Enter a key to begin test' key = GETCHARQQ() ! Must call GETCHARQQ first do while (.NOT. pressed) write (*, 900) '*' ! Print stars until a key is pressed pressed = PEEKCHARQQ() end do900 format (1X, A, \) end |
Additional reference words: 1.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |