BREAK Statement
Enables or disables the break function on the terminal.
Syntax
BREAK {KEY} OFF
BREAK {KEY} ON
BREAK expression
Syntax Elements
expression is any valid DataBasic expression that evaluates to a numeric value.
If expression evaluates to zero, the break function is disabled.
If expression evaluates to a nonzero value, the break function is enabled.
Operation
BREAK OFF disables the break function on the terminal. This can be used to prevent a user from stopping program execution during a critical process, such as a file update.
BREAK ON restores normal operation to the break function where pressing BREAK or CTRL+BREAK causes a "break" to the DataBasic symbolic debugger. Normal operation is also restored when the program ends.
Comments
The current state of the break function can be determined using the SYSTEM(23) function.
Note
These statements should only be used in a debugged program. If a program gets into an endless loop while the break function is disabled, you cannot stop the process on the terminal on which it was started.
Examples
BREAK KEY OFF
WRITE ITEM ON FILE,A
Disables the break function on the terminal while ITEM is being written to a file. This prevents interruption of the attempt to update the FILE, even if the BREAK (or CTRL+BREAK) key is pressed.
BREAK ON
Re-enables the break function.
BREAK X+5
Enables the break function if X+5 is nonzero, otherwise, the break function is disabled.
:
ENABLE-BREAK-KEY
This TCL command re-enables the break function on the current terminal.
See Also
FOR Statement - Loop Control Statements, LOOP Statement - Loop Control Statements.