logo
Powered by QM on a Rpi server

KnowledgeBase 00118: Break Key Options

Last updated: 22 Jul 2016
Applies to: All versions
Search  
Top level index       Full Index Search Tips
Previous article     Next article

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.


Subtitle

The prompt displayed when the break key is pressed allows the following responses:

AAbort, running the ON.ABORT script if present in the VOC.
DEnter the debugger if the current program or any below it in the call stack was compiled in debug mode.
GGo. 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.
PCreate a program dump file showing the state of all programs in the call stack.
QQuit. Behaves as though the program had executed a STOP statement.
SShow the call stack, displaying both external (CALL) and internal (GOSUB) layers.
WWhere. Show the current program name and line number.
XExit from QM.
?Show help text.


Changing the Break Key

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 24 
Both 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).


Enabling and Disabling the Break Key

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 ON 
or the QMBasic PTERM() function
   X = PTERM(PT$BREAK, @TRUE) 

Conversely, the break key can be disabled at any time with

   PTERM BREAK OFF 
or the QMBasic PTERM() function
   X = PTERM(PT$BREAK, @FALSE) 


Related Articles

00032: Process Dump Files



Please tell us if this article was helpful
Very     Slightly     Not at all
Comments
Email (optional)