Logo

Hacker’s Guide to Visual FoxPro
An irreverent look at how Visual FoxPro really works. Tells you the inside scoop on every command, function, property, event and method of Visual FoxPro.

SET ESCAPE, Set(“Escape”)

This command controls whether the Esc key interrupts program execution. It doesn’t control whether Esc closes windows, chooses Cancel buttons, and so forth.

Usage

SET ESCAPE ON | OFF
cOnOrOff = SET("ESCAPE")

SET ESCAPE also controls ON ESCAPE. When ESCAPE is OFF, the escape handler specified with ON ESCAPE is ignored.

SET ESCAPE is only one part of turning off the Esc key in an application. It keeps the user from interrupting your program—generally a good thing to do. But it still leaves Esc available in forms and Browses and other places. This is usually what we want (once we’ve finished debugging the application, anyway).

If you really want to make Esc dead, dead, dead, SET ESCAPE OFF and issue ON KEY LABEL ESCAPE *, which tells FoxPro to execute a comment when the user presses Esc.

Example

SET ESCAPE OFF

See Also

Cancel, On Escape, On Key Label