FIX: INKEY() Waits Indefinately If User & Edit Windows Active

Last reviewed: October 20, 1997
Article ID: Q129844
2.60a MACINTOSH kbprg kbfixlist kbbuglist

The information in this article applies to:

  • Microsoft FoxPro for Macintosh, version 2.6a

SYMPTOMS

INKEY() waits indefinitely for a keystroke with <expN> set to a value that is greater than zero (0). This occurs only if a User Defined Window and a Text Editing Window are active before the INKEY() command.

NOTE: This behavior does not occur in FoxPro for Windows or MS-DOS.

RESOLUTION

If you want INKEY() to wait for a keystroke for a specified period of time and you also want to activate a User Defined Window before the INKEY() command, then before doing so, make sure that you do not have an active Text Editing Window.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in Visual FoxPro 3.0b for Macintosh.

MORE INFORMATION

Steps to Reproduce Problem

  1. Create a Program called INKYTST.PRG that contains the following code:

    DEFINE WINDOW tstwin from 2,2 to 10,40 float grow &&User Defined Window ACTIVATE WINDOW tstwin

       =INKEY(3)        &&Wait 3 seconds for a keystroke
       DEACTIVATE WINDOW tstwin
    
    

  2. After entering the commands, leave the Text Editing Window for INKYTST.PRG open, and run the program.

  3. Notice that the program does not terminate after three seconds as specified by the number assigned to the <expN> clause. It will wait indefinitely for a keystroke.


Additional reference words: fixlist3.00b VFoxMac FoxMac 2.60a buglist2.60a
KBCategory: kbprg kbfixlist kbbuglist
KBSubcategory: FxprgGeneral
Keywords : FxprgGeneral kbbuglist kbfixlist kbprg
Version : 2.60a
Platform : MACINTOSH
Solution Type : kbfix


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: October 20, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.