Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29235 Discussions

View "print" output from Fortran program

kimball__bruce
Beginner
1,895 Views

I am new to the Intel Visual Fortran Compiler for Windows, but I have succeeded in running the little print *, "Hello World" program. However, I have a number of older programs that I wish to continue to use that print important messages to the user. The problem is the that the screen to which the print messages are written appears and disappears in an instant -- far to fast to read.

How can make this screen stay visible? Or make the printed messages visible some other way?

0 Kudos
3 Replies
DavidWhite
Valued Contributor II
1,895 Views

One way is to add a read statement at the end of the program, which simply reads into a single character variable.  The user then needs to press Enter to close the program.

If you were in a command window, and run the program, then even though the program has exited, the output would still be visible.  The window closing and losing the output is due to the command window being executed from within VS.

David

0 Kudos
jimdempseyatthecove
Honored Contributor III
1,895 Views

If you are launching the Release build from VS, instead of Run, use "Debug | Start without debugging". This will keep the command window open.

If you are running from Icon Double-Click you can use the READ as David mentions, or you can use the PAUSE statement

PAUSE "Press RETURN to end program"

Jim Dempsey

0 Kudos
kimball__bruce
Beginner
1,895 Views

Adding PAUSE statements works beautifully! Thank you both.

0 Kudos
Reply