ON Statement (Executable) [ HP FORTRAN 77/iX Reference ] MPE/iX 5.0 Documentation
HP FORTRAN 77/iX Reference
ON Statement (Executable)
The ON statement specifies the action to be taken following a subsequent
interruption of program execution.
The interrupt_condition specifies the interrupt to be handled, such as an
arithmetic error or a keyboard interrupt.
Parameters
interrupt_condition Keywords specifying an interrupt condition,
as given in Table 3-8 .
trap_procedure A procedure that will be executed if the
specified interrupt_condition occurs
following the execution of the ON statement.
Before an interrupt can be trapped, the flow of control must pass through
an ON statement that specifies the particular interrupt condition. Once
established, an interrupt trap can only be changed by another ON
statement that specifies the same interrupt condition.
Table 3-8. Interrupt Conditions
----------------------------------------------------------------------------------
| | | |
| Type of Trap | Interrupt_Condition | Equivalent Keywords |
| | Keywords | |
| | | |
----------------------------------------------------------------------------------
| | | |
| Arithmetic | REAL*4 DIV 0 | REAL DIV 0 |
| | REAL*4 OVERFLOW | REAL OVERFLOW |
| | REAL*4 UNDERFLOW | REAL UNDERFLOW |
| | REAL*4 INEXACT | REAL INEXACT |
| | REAL*4 ILLEGAL | REAL ILLEGAL |
| | | |
| | REAL*8 DIV 0 | DOUBLE PRECISION DIV 0 |
| | REAL*8 OVERFLOW | DOUBLE PRECISION OVERFLOW |
| | REAL*8 UNDERFLOW | DOUBLE PRECISION UNDERFLOW |
| | REAL*8 INEXACT | DOUBLE PRECISION INEXACT |
| | REAL*8 ILLEGAL | DOUBLE PRECISION ILLEGAL |
| | | |
| | REAL*16 DIV 0 | (none) |
| | REAL*16 OVERFLOW | (none) |
| | REAL*16 UNDERFLOW | (none) |
| | REAL*16 INEXACT | (none) |
| | REAL*16 ILLEGAL | (none) |
| | | |
| | INTEGER*2 DIV 0 | INTEGER DIV 0 2 |
| | INTEGER*2 OVERFLOW 1 | INTEGER OVERFLOW 1,2 |
| | INTEGER*4 DIV 0 | INTEGER DIV 0 2 |
| | INTEGER*4 OVERFLOW 1 | INTEGER OVERFLOW 1,2 |
| | | |
----------------------------------------------------------------------------------
| | | |
| System | SYSTEM ERROR | (none) |
| | | |
----------------------------------------------------------------------------------
| | | |
| Basic External | EXTERNAL ERROR | (none) |
| Function | | |
| | | |
----------------------------------------------------------------------------------
| | | |
| Internal Function | INTERNAL ERROR | (none) |
| | | |
----------------------------------------------------------------------------------
| | | |
| Control-Y | CONTROLY | (none) |
| | | |
----------------------------------------------------------------------------------
| |
| Notes: |
| |
| 1. There is no check for integer overflows unless the CHECK_OVERFLOW |
| directive is included to generate the overflow-checking code. |
| |
| 2. If INTEGER is specified, the trap handling is set for the default |
| integer type, as defined by the SHORT or LONG compiler directive. |
| |
| |
----------------------------------------------------------------------------------
There are three possible actions:
* The ABORT option causes the program to abort.
* The CALL option specifies a subroutine to be executed.
* The IGNORE option causes the interrupt to be ignored.
For further information about the range of values for interrupt_condition
and the details of the actions, as well as sample programs for trapping
external and internal errors, see "Trapping Run-Time Errors" and
refer to the HP Compiler Library/iX Reference Manual.
MPE/iX 5.0 Documentation