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

Keeping console window after runtime error?

patrikwallman
Beginner
447 Views
In a Fortran console project, is there anyway to avoid the automatic closing of the console window after a runtime error without adding error handling of every single error that might occur?

As an example, if a file is missing (and if I forgot to check that the file existed before trying to open it with status='old') an error message is printed in the console window, but within a fraction of a second the entire window dissappears. When this happens to me, I can of course go into debug mode within Visual Studio and find out what happened, but if it happens to someone I distributed the executable to there seems to be no way to figure out what went wrong.

As a comparison, using the Absoft compiler (at least in the MacOS versions) you use the command setprefs to set the behaviour (either remaining window after program finishes or closing window)

0 Kudos
2 Replies
james1
Beginner
447 Views
Just have them run a batch file rather than the executable itself. In the batch file run the executable, followed by pause as necessary.

James
0 Kudos
henrylou
Beginner
447 Views
or run in Command mode?
0 Kudos
Reply