Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
Fortran 90 Compiler for HP-UX: Fortran 90 Programmer's Guide

Chapter 5 Using the ON statement

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

Whenever a runtime error occurs, the default action of your program depends on the type of the error. If the error results from a floating-point exception, the program will continue to execute. Other errors will cause it to abort.

As described in “Handling runtime exceptions”, the +fp_exception and +FP options provide control over how a program behaves when a runtime error occurs. The ON statement provides an additional level of control by enabling your program to handle floating-point and integer exceptions and +Ctrl-C interrupts. Before an exception can be handled, the flow of control must pass through an ON statement that specifies:

  • The type of the exception

  • One of the following actions:

    • Execute a trap procedure

    • Ignore the interrupt

    • Abort the program

The action specified by the ON statement can only be changed by another ON statement that specifies the same exception.

This chapter describes how to use the ON statement. The syntax of the ON statement is described in the HP Fortran 90 Programmer's Reference. For detailed information about trapping math errors, see the HP-UX Floating-Point Guide.

NOTE: If you include the ON statement in a program that you optimize at level 2 or higher and the program takes an exception, the results may vary from those you would get from an unoptimized program or from a program that didn't have the ON statement.
Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.