| United States-English |
|
|
|
![]() |
Fortran 90 Compiler for HP-UX: Fortran 90 Programmer's Guide > Chapter 5 Using the ON statementTrapping +Ctrl-C trap interrupts |
|
A +Ctrl-C interrupt can occur during the following circumstances:
The trap procedure for a +Ctrl-C interrupt must have no formal arguments. The interrupt code is the character defined by the HP-UX stty(1) command for the intr parameter. The system default for intr is +Ctrl-C. You can use the +Ctrl-C form of the ON statement to handle the interrupt signal 2. In the following example, when an interrupt occurs, the program reports status information on standard output, assuring the user that the program is still at work in the DO loop. The program uses the ON statement to set the action for a +Ctrl-C interrupt to be the call to the trap handler status:
When this program is run, a +Ctrl-C interrupt causes the status routine to be called, which prints the iteration count. The program then resumes executing the DO loop. |
||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||