ON ESCAPE Command

Example   See Also

Specifies a command that executes when you press the ESC key during program or command execution.

Syntax

ON ESCAPE
  [Command]

Arguments

Command

Specifies the Visual FoxPro command to execute. After the command executes, program execution resumes on the line immediately following the program line that was executing when you pressed ESC. However, if a procedure specified with ON ESCAPE includes RETRY, the program line that was executing when you pressed ESC executes again.

Remarks

Typically, ON ESCAPE uses DO to execute a procedure.

If both ON ESCAPE and ON KEY are in effect and you press ESC, Visual FoxPro executes the command specified with ON ESCAPE.

Use ON ESCAPE without a command to cause no command to execute when ESC is pressed (the default).

Note   Visual FoxPro doesn't execute an ON ESCAPE routine if SET ESCAPE is OFF.