How to Undo ON KEY LABEL ENTER Command After ErrorID: Q113922 The information in this article applies to:
SUMMARYUnder certain circumstances, you may want to redefine the ENTER key so that it performs an action, such as executing a procedure. However, if an error occurs during development before the ENTER key is returned to its original state, no commands can be entered in the Command window, and the statement following the ON KEY LABEL ENTER command will attempt to execute instead.
MORE INFORMATIONIssuing the command "ON KEY LABEL ENTER <function or command>" prior to the point at which that action is desired will cause that statement to be executed when the ENTER key is pressed. To return the ENTER key to its normal functionality, the command "ON KEY LABEL ENTER" (with nothing following it) should be the first line of code in the procedure or function (or the second line if there is a PARAMETER statement). However, errors may occur before the line returning the ENTER key to the default is executed, preventing the ENTER key from terminating commands in the Command window. The following methods will allow you to restore the normal functionality of the ENTER key. After returning to the Command window from the error condition, do the following:
Method 11. In FoxPro for MS-DOS, choose Macros from the System menu. In FoxPro for 2. Select an unused default macro, such as F3.
4. Choose the Edit button. 5. Type the following:
6. Choose OK twice to close the Edit and Macros windows.
7. Press the macro key you just assigned. NOTE: The above method will not work if the macro key you chose is already assigned an action by an ON KEY LABEL command. For example, if the command ON KEY LABEL F3 WAIT WIND TIME() is issued at the beginning of a FoxPro session and is never released, the macro editor will still show the default of "LIST{ENTER}" for F3. Even though the macro is redefined, the ON KEY LABEL trap will have precedence, and the current time will be displayed instead.
Method 21. From the File menu, choose New. In the New File dialog box, choose 2. In the UNTITLED.PRG window, type the following command:
3. Press CTRL+O to execute the program and choose Yes to save changes.
The ENTER key is now reset.
Additional reference words: FoxDos FoxWin 2.50 2.50a 2.50b 2.60 hung hang return ignored KBCategory: kbprg KBSubcategory: FxprgGeneral |
|
Last Reviewed: June 27, 1995 © 1999 Microsoft Corporation. All rights reserved. Terms of Use. |