PAUSE

Statement: Temporarily suspends program execution and lets you execute operating system commands during the suspension. The PAUSE statement is a deleted feature in Fortran 95; it was obsolescent in Fortran 90. Intel Fortran fully supports features deleted in Fortran 95.

Syntax

PAUSE [pause-code]

pause-code
(Optional) Is an optional message. It can be either of the following:


Description

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 Windows* 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.

Effect on Linux* and Mac OS* Systems

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

See Also

STOP, SYSTEM, Obsolescent and Deleted Language Features

Examples

The following examples show valid PAUSE statements:

  PAUSE 701
  PAUSE 'ERRONEOUS RESULT DETECTED'

The following shows another example:

  CHARACTER*24 filename
  PAUSE 'Enter DIR to see available files or press RETURN'   &
 &' if you already know filename.'
  READ(*,'(A\)') filename
  OPEN(1, FILE=filename)
  . . .