A call to FCONTROL with a controlcode
value of 16 or 17 determines whether or not a terminal will react
to a subsystem break request. (The default subsystem break character
is [CTRL]Y.) Use 16 to disable subsystem break,
17 to enable subsystem break.
Subsystem break is initially disabled on all devices; it must
be specifically enabled before it can be used. It is available only
for devices running sessions, and has no effect on programmatically
controlled devices. Subsystem break is reset to the disabled state
at FCLOSE.
If enabled, subsystem break allows the terminal user to stop
a program local or subsystem local command. It is invoked in standard
editing mode by the end-of-medium (EM) character, produced on HP
terminals by typing [CTRL]Y.
Even when subsystem break is enabled for a terminal connected
via PAD, subsystem break must be followed by a [Return]
to signal the PAD that data is ready to be forwarded.
You can also use FDEVICECONTROL to alter the subsystem break
character in either standard or transparent mode. See the discussion
of the FDEVICECONTROL intrinsic later in this chapter for the proper
parameter settings to use for this purpose.
In transparent editing mode, you are allowed to define a different
character to be used to invoke subsystem break by specifying the
new character as part of param in a call
to FCONTROL(41).
Before subsystem break can be successfully enabled, your program
must call the XCONTRAP intrinsic, which arms a special trap procedure
referred to as the [CTRL]Y Trap. The external label
of a user written procedure is specified as the value of the plabel
parameter in the call to XCONTRAP.
The procedure specified must define the steps that will be
taken if subsystem break is entered during execution of your program.
Once the [CTRL]Y Trap has been armed by XCONTRAP,
the terminal user can successfully invoke the subsystem break function.
Whenever a subsystem break is entered, the [CTRL]Y
Trap is automatically disarmed. Your program must call the RESETCONTROL
intrinsic to re-arm the trap when it is ready to allow another subsystem
break to occur. If RESETCONTROL is not called after a subsystem
break, it is not possible to enter another subsystem break.
The following summarizes subsystem break processing and the
intrinsics involved:
A user written procedure must be provided
to define how the program should act upon receiving a subsystem
break.
A call to XCONTRAP must be included in the program,
specifying the external label of the procedure written in Step 1
as the value of plabel. This arms the [CTRL]Y
Trap.
A call to FCONTROL(17) must be included in the program
to enable the subsystem break function.
If the subsystem break character is received during
execution of the program, the procedure specified in the call to
XCONTRAP is executed.
A call to RESETCONTROL must be executed when the
program is ready to receive another subsystem break. (This is usually
done in the user written subsystem break handling procedure.)
A new subsystem break character may be defined through
FCONTROL(41), if the terminal is placed in transparent mode, or
through FDEVICECONTROL.
If desirable at any time, FCONTROL(16) may be called
to disable subsystem break. A call to FCONTROL(17) enables it again.