02.07.2013 Views

HP Fortran Programmer's Reference

HP Fortran Programmer's Reference

HP Fortran Programmer's Reference

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ON (extension)<br />

Specifies the action to take when program execution is interrupted.<br />

Syntax<br />

ON interrupt-condition action<br />

interrupt-condition<br />

action<br />

Description<br />

<strong>HP</strong> <strong>Fortran</strong> statements<br />

ON (extension)<br />

is the interrupt to be handled, either an arithmetic error or a keyboard<br />

interrupt.<br />

is one of the following:<br />

where:<br />

CALL trap-routine<br />

ABORT<br />

IGNORE<br />

trap-routine<br />

is an external subroutine name.<br />

The ON statement is an <strong>HP</strong> extension. It is an executable statement that specifies the action to<br />

be taken after the occurrence of an exception that interrupts program execution.<br />

For each interrupt-condition, you can specify one of the following actions:<br />

CALL: specifies a subroutine to be called.<br />

ABORT: causes the program to abort.<br />

IGNORE: causes the interrupt to be ignored.<br />

Table 10-32 lists the range of values for interrupt-condition. The first column identifies<br />

thetypeoftrap;thesecondgivesthekeywordsthatmustappearontheON statement,<br />

immediately following the word ON; and the third column gives equivalent keywords you can<br />

specify instead of those in the second column. For example, the following ON statement causes<br />

the program to trap an attempt to divide by zero with 8-byte floating-point operands, passing<br />

control to a user-written trap handler called div_zero_trap:<br />

Chapter 10 373

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!