ProvideX V8.20 > Language Reference > 2. Directives
121
ESCAPE Directive
             Interrupt Program Execution
Format
ESCAPE [err_val]
Where:
Optional numeric value to be placed in the ERR variable. (ProvideX
err_val
interprets this as an error code and the system logic kicks in.)
Description
When you use the ESCAPE directive in Execution mode, ProvideX suspends
execution of the current program, lists the current statement (the line number with
the ESCAPE directive), and returns you to Command mode. Use the RUN directive to
have the program resume where it left off.
Simplify the debugging process by placing ESCAPE statements strategically in your
program. When execution is suspended, you are returned to Command mode, where
you can evaluate execution and the values of variables, etc. (up to the line where you
placed the ESCAPE in your application).
If you use ESCAPE in Command mode, ProvideX lists the next statement to be processed,
if any. If you specify an error value, the ESCAPE directive will generate an error with that
specific error value. Use this to provide an error exit in a multi-line function.
The *ESCAPE label emulates an ESCAPE directive for use as a statement reference.
Note: The 'XT' system parameter is automatically reset to prevent session termination
when the ESCAPE directive is used in a program.
See Also
DEF FN Define Function, p.67
Labels/Logical Statement References , p.814
Example
0100 PRINT "BEGIN"; ESCAPE; PRINT "DONE"
When run would yield
BEGIN
0100 PRINT "BEGIN"; ESCAPE; PRINT "DONE"
1> Command mode prompt
Entry of a 'RUN' command would yield: DONE