HP 3000 Manuals

MPE XL CONTROL-Y Traps [ Trap Handling Programmer's Guide ] MPE/iX 5.0 Documentation


Trap Handling Programmer's Guide

Chapter 4  MPE XL CONTROL-Y Traps 

If you are running a program in an interactive session, you can arm a
trap handling procedure that receives control whenever a subsystem break
signal is entered from the session terminal.  On most terminals, you
transmit the subsystem break signal by pressing the [[CTRL]] [[Y]] key.
To do this, press the [[Y]] key while holding down the [[CTRL]] key.  For
this reason, subsystem break traps are commonly called CONTROL-Y traps.


NOTE You can change the key that causes such a subsystem break. Refer to the discussion of controlcode 25 of the FCONTROL intrinsic in the MPE XL Intrinsics Reference Manual (32650-90028).
There are two MPE XL intrinsics that are used in handling CONTROL-Y traps: * XCONTRAP * RESETCONTROL The XCONTRAP intrinsic arms or disarms the user-written CONTROL-Y trap handling procedure. When a process is initiated, it has no CONTROL-Y trap handler. Only one process in a session can receive a CONTROL-Y trap at any one time. The process that called XCONTRAP most recently receives the next CONTROL-Y trap. Once a process has received a CONTROL-Y trap, it cannot receive another until it calls the RESETCONTROL intrinsic. Only processes running in a session can arm CONTROL-Y traps. The trap handler can be any procedure in the program or in the libraries to which the program is bound. The CONTROL-Y trap handler has no parameters. The RESETCONTROL intrinsic resets the CONTROL-Y trap for a process so the process can accept another subsystem break signal. The process must have previously armed a CONTROL-Y trap handler with the XCONTRAP intrinsic. After your CONTROL-Y trap handler has been invoked, you should call RESETCONTROL when you are ready to receive another subsystem break signal. RESETCONTROL can be called from within the CONTROL-Y trap handler, or from any other procedure.
NOTE Once your process has received a subsystem break signal, only a call to RESETCONTROL allows it to receive another such signal. Calling XCONTRAP again does not have this effect.
Discussions of these intrinsics follow.


MPE/iX 5.0 Documentation