Expand/Shrink

allow_break

Definition: allow_break(bool bAllow)
Description: Determine whether control-c/control-break should terminate the program.
If bAllow is true then allow that, else/false, don’t.
Initially those keystrokes *will* terminate the program, but only when it actually tries to read input from a console.

Note that GUI applications do not normally terminate when such keystrokes are received, unless explicitly coded to do so.
pwa/p2js: Not supported
Comments: DOS will display ^C on the screen, even when your program cannot be terminated.

Initially your program can be terminated at any point where it tries to read from the keyboard. It could also be terminated by other input/output operations depending on options the user has set in his config.sys file. (Consult an MS-DOS manual for the BREAK command.) For some types of program this sudden termination could leave things in a messy state and might result in loss of data. allow_break(0) lets you avoid this situation.

You can find out if the user has pressed control-c or control-Break by calling check_break().
Example:
allow_break(0)  -- don't let the user kill me!
Implementation: See builtins\pbreak.e (an autoinclude) for details of the actual implementation.
See Also: check_break