PRB: ON KEY LABEL <key label> KEYBOARD "{ESC}" Does Not Work

Last reviewed: June 27, 1995
Article ID: Q121961
The information in this article applies to:
  • Microsoft FoxPro for MS-DOS, Versions 2.5x, 2.6, 2.6a
  • Microsoft FoxPro for Windows, Versions 2.5x, 2.6, 2.6a
  • Microsoft FoxPro for Macintosh, Version 2.5x, 2.6, 2.6a

SYMPTOMS

Using the ON KEY LABEL to define another key on the keyboard to act as if it were the ESC key does not work.

CAUSE

Issuing the command ON KEY LABEL <key label> KEYBOARD "{ESC}" at the Command Window or in a program will cause the following error:

in FoxPro for MS-DOS:

                         Interrupted
                 <Cancel> <Suspend> <Ignore>

in FoxPro for Windows, and FoxPro for Macintosh:

                       Program Error
                        Interrupted
                 <Cancel> <Suspend> <Ignore>

This error is caused because the ON KEY LABEL routine thinks that it is being interrupted and asks the user to Cancel, Suspend, or Ignore itself.

RESOLUTION

To enable the ON KEY LABEL to define another key on the keyboard as the ESC key without generating an error, add the PLAIN clause:

   ON KEY LABEL <key label> KEYBOARD "{ESC}" PLAIN

By adding this clause, you tell FoxPro to place the literal key label into the keyboard, not the key assignment. It is the key assignment that causes the error to occur.


Additional reference words: FoxWin FoxDos FoxMac on key label keyboard esc
escape 2.00 2.50 2.50a 2.50b 2.50c 2.60 2.60a
KBCategory: kbprg kbui kbtshoot kbprb
KBSubcategory: FxprgGeneral



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: June 27, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.