Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29257 ディスカッション

PAUSE statement is obsolete?

blueyedtam
ビギナー
1,898件の閲覧回数

I was wondering if it was replaced by anything that might be more useful.

The reason why -- I want to be able toexamine the console output window just before the program exits. If I don't put the PAUSE statement there, the window disappears before I have a chance to look at the printout....

I tried using STOP, but that doesn't work because the output disappears immediately.

A READ statement would do the job, but that seems to be kinda mickey-mouse.

So, was that replaced by anything else?

0 件の賞賛
2 返答(返信)
Steven_L_Intel1
従業員
1,898件の閲覧回数
PAUSE is indeed a deleted feature in Fortran 2003 but most compilers, including ours, still support it. The standard suggests writing to and then reading from standard output - for your purpose, a simple:

read (*,*)

will do the trick and is very common.
g_f_thomas
ビギナー
1,898件の閲覧回数

If you debug your program then setting a breakpoint 'pauses'

Here's another way to pause without PAUSE:

call wait()

Subroutine wait()

implicit none

character(1) Key

write *, 'press any key to continue'

Key = GETCHARQQ()

end subroutine wait

Gerry

返信