Asynchronous Serial Communications Programmer's Reference Manual (32022-90052)

112 Chapter5
Using Subsystem Break
The Break Keys
The Break Keys
Two kinds of breaks can be made available to users running in session
mode. System break, the so called “hard” break, lets the terminal user
suspend the currently running process and access the Command
Interpreter to enter MPE/iX commands. The user can then type
:RESUME to return to the interrupted process or :ABORT to terminate
the suspended process. System break is enabled by default; you must
explicitly disable system break through the FCONTROL (or
FDEVICECONTROL) intrinsic.
The second kind of break that can be made available, subsystem break,
must be explicitly enabled by your program. Subsystem break allows
you to specify the exact way your program will respond to a user who
invokes subsystem break while the program is executing.
Subsystem break is often referred to as
[CTRL]Y break, because the
common default for subsystem break is
[CTRL]Y, activated by pressing
the
[CTRL] key and the Y key simultaneously. This sends an
end-of-medium (EM) signal when entered from any MPE/iX supported
terminal. If subsystem break is enabled for the program running on the
terminal, this signal causes the program to pass control to a break
handler subroutine.
It is a good idea to include subsystem break processing capabilities in
any program that may be used to perform time consuming tasks, such
as listing a large file or searching a database for specific information.
By including a subsystem break routine you make it possible for the
user to change his mind and interrupt a task without aborting the
application.
A subsystem break procedure will usually allow the user to interrupt
the program at any point to return to the main program prompt or
menu. The procedure may also write a line of information to the
terminal to indicate that a subsystem break has occurred. You, as the
programmer, control exactly what will take place when subsystem
break is entered by the way you program the break handler subroutine.
Subsystem break may be invoked in either standard or transparent
editing mode, but the program must be running in a session in order for
it to have any effect. You should not attempt to enable subsystem break
if your program is performing block mode reads. Subsystem break is
automatically disabled at FCLOSE.