- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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)
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)
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
James
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
or run in Command mode?
![](/skins/images/D3C0B914909A6564BBB97F4AD1ED1973/responsive_peak/images/icon_anonymous_message.png)
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page