|Powered by QM on a Rpi server|
This article was originally published as a Tip of the Week.
When the user presses the break key, usually Ctrl-C, QM offers far more than just quit or continue.
The prompt displayed when the break key is pressed allows the following responses:
|A||Abort, running the ON.ABORT script if present in the VOC.|
|D||Enter the debugger if the current program or any below it in the call stack was compiled in debug mode.|
|G||Go. Resume program execution as though the break key had not been pressed. If the terminal device supports screen save and restore, the screen is restored to its state before the break key was pressed.|
|P||Create a program dump file showing the state of all programs in the call stack.|
|Q||Quit. Behaves as though the program had executed a STOP statement.|
|S||Show the call stack, displaying both external (CALL) and internal (GOSUB) layers.|
|W||Where. Show the current program name and line number.|
|X||Exit from QM.|
|?||Show help text.|
The break key is bound to Ctrl-C by default. This can be changed by use of the PTERM command, for example
PTERM BREAK ^X PTERM BREAK 24Both of the above examples set the break key to be Ctrl-X (character 24). The same effect can be achieved using the QMBasic PTERM() function
X = PTERM(PT$BRKCH, 24)In all cases, the break key must be in the range char(1) to char(31).
The break key is disabled until after execution of the optional LOGIN command script at which point it is enabled. If an application is started from the LOGIN script, the break key will continue to be disabled unless explicitly enabled using
PTERM BREAK ONor the QMBasic PTERM() function
X = PTERM(PT$BREAK, @TRUE)
Conversely, the break key can be disabled at any time with
PTERM BREAK OFFor the QMBasic PTERM() function
X = PTERM(PT$BREAK, @FALSE)
00032: Process Dump Files