SET ESCAPE OFF Does Not Disable the ESC KeyLast reviewed: April 29, 1996Article ID: Q98444 |
The information in this article applies to:
SUMMARYThe command SET ESCAPE OFF does not disable the ESC key.
MORE INFORMATIONSET ESCAPE OFF keeps the user from interrupting executing lines of code by pressing the ESC key; however, SET ESCAPE OFF will not prevent a user from escaping from an active READ. The reason is that a READ, unlike most commands, creates a wait state; that is, it begins a period of waiting (often for input) that continues. Since the READ instruction may not finish for some time, keyboard input, including the ESC key, is interpreted by the READ, not by SET ESCAPE OFF, which cannot trap the ESC key in the middle of an executing instruction; therefore, the READ reacts to the ESC key (and often this means a screen with active GETs is terminated). If the ESC key is pressed while non-wait-state lines of code are executing, the ESC key will be buffered temporarily until the current instruction finishes, and then the ESC key will be trapped as expected, permitting continued program execution. The SET ESCAPE command determines whether FoxPro will interrupt executing code when the ESC key is pressed. If SET ESCAPE is ON and code is being executed, FoxPro will display the "*** INTERRUPTED ***" error message. If SET ESCAPE is OFF, the program will not be halted. If a READ is in effect and the program is sitting idle at that READ when the ESC key is pressed, the READ will be terminated regardless of the setting of ESCAPE and no message will appear. To disable the ESC key, issue the following command:
ON KEY LABEL ESC *This command completely disables the ESC key until ON KEY LABEL ESC is issued. To disable any other key, substitute the appropriate key name for ESC in the above command. NOTE: If you have saved the environment with the screen or are opening a view, the SET ESCAPE OFF and ON KEY LABEL ESC * commands may not work as expected if the environment or view had different settings for these commands. To work around this, you can explicitly enter these commands in the Command window before saving the environment or view. An alternative workaround regarding the environment is to not save the environment with the screen; instead use code to explicitly create the environment.
|
Additional reference words: VFoxWin 3.00 FoxDos FoxWin 2.00 2.50 2.50a
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |