FORTRAN 77 Language Reference

PAUSE

The PAUSE statement suspends execution, and waits for you to type: go.

PAUSE [str]

Parameter 

Description 

str

String of not more than 5 digits or a character constant  

Description

The PAUSE statement suspends program execution temporarily, and waits for acknowledgment. On acknowledgment, execution continues.

If the argument string is present, it is displayed on the screen (written to stdout), followed by the following message:


       PAUSE. To resume execution, type: go 
Any other input will terminate the program. 

After you type: go, execution continues as if a CONTINUE statement is executed. See this example:


demo% cat p.f 
       PRINT *, "Start" 
       PAUSE 1 
       PRINT *, "Ok" 
       END 
demo% f77 p.f -silent
demo% a.out 
Start 
PAUSE: 1 
To resume execution, type: go 
Any other input will terminate the program. 
go 
Execution resumed after PAUSE. 
Ok 
demo%

If stdin is not a tty I/O device, PAUSE displays a message like this:


PAUSE: To resume execution, type: kill -15 pid 

where pid is the process ID.

Example: stdin not a tty I/O device:


demo% a.out < mydatafile 
PAUSE: To resume execution, type: kill -15 20537 
demo%

For the above example, type the following command line at a shell prompt in some other window. The window displaying the message cannot accept command input.


demo% kill -15 20537