7.8 PAUSE Statement

The PAUSE statement temporarily suspends program execution until the user or system resumes execution. The PAUSE statement is an obsolescent feature in Fortran 90, which has been deleted in Fortran 95. Compaq Fortran fully supports features deleted in Fortran 95.

The PAUSE statement takes the following form:

 PAUSE [pause-code]
pause-code
Is an optional message. It can be either of the following:

Rules and Behavior

If you specify pause-code, the PAUSE statement displays the specified message and then displays the default prompt.

If you do not specify pause-code, the system displays the following default message:

FORTRAN PAUSE

The following prompt is then displayed:

Effect on OpenVMS Systems

The effect of PAUSE differs depending on whether the program is an interactive or batch process, as follows:

Effect on Tru64 UNIX Systems

The effect of PAUSE differs depending on whether the program is a foreground or background process, as follows:

Effect on Windows NT and Windows 9* Systems

The program waits for input on stdin. If you enter a blank line, execution resumes at the next executable statement.

Anything else is treated as a DOS command and is executed by a system( ) call. The program loops, letting you execute multiple DOS commands, until a blank line is entered. Execution then resumes at the next executable statement.

Examples

The following examples show valid PAUSE statements:

PAUSE 701
PAUSE 'ERRONEOUS RESULT DETECTED'

For More Information:


Previous Page Next Page Table of Contents