Keeping console window after runtime error?

Keeping console window after runtime error?

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)

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

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

or run in Command mode?

Leave a Comment

Please sign in to add a comment. Not a member? Join today