CANCEL
Halts program execution.
Syntax
CANCEL
Description
Use CANCEL to cancel program execution in the midst of a process. You can also issue CANCEL in the Command window when a program is suspended (with SUSPEND) to cancel execution of the suspended program.
While procedural applications are characterized by deeply nested subroutines that wait for user actions, applications in dBASE Plus are event-driven; objects sit on-screen, waiting for something to happen. While waiting for an event, no programs are being executed. When an event occurs, the event handler is fired, and when that’s done, dBASE Plus goes back to waiting for events. In the dBASE IDE, issuing CANCEL will halt the current event handler thread, but does not cause dBASE Plus to stop responding to events (similar to choosing the Cancel option from a dBASE error dialog) . To cause dBASE objects to stop responding to events the object itself must be removed from the screen or destroyed.
A process that is halted simply stops; no message or exception is generated. In the main routine of a process, issuing CANCEL has the same effect as issuing RETURN: the process is terminated. A program or thread halted by CANCEL performs the standard cleanup for a completed process. All local and private memory variables are cleared. Control returns to the object that started the process, if it’s still available; usually a form, menu, or the Command window.
In the dBASE Runtime, issuing CANCEL will halt execution of an application and cause it to shutdown.