- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dears,
I looked into documentation in the compilation options but did not find a switch not to close the console window after program terminates. It is often that I need to see what happened in the IMSL - I redirected the error to file but I prefer to see them on the console window.
And I do not know if it is default behaviour but it seems so - when I start console program it hides running under the VS2008 window - it is not good because if something fails at the beginning I'm sometimes even not able to switch into that window because it finishes and disappears immediately.
Maciej
I looked into documentation in the compilation options but did not find a switch not to close the console window after program terminates. It is often that I need to see what happened in the IMSL - I redirected the error to file but I prefer to see them on the console window.
And I do not know if it is default behaviour but it seems so - when I start console program it hides running under the VS2008 window - it is not good because if something fails at the beginning I'm sometimes even not able to switch into that window because it finishes and disappears immediately.
Maciej
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you use "Start without debugging", then the console window will stay up after the program exits. If you start it under the debugger, then the window will go away when the program exits and there is no switch to control that.
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you use "Start without debugging", then the console window will stay up after the program exits. If you start it under the debugger, then the window will go away when the program exits and there is no switch to control that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there a way for a Fortran console app to trap fatal Fortran run-time errors, so either (1) the user sees the error traceback on the console; or (2) a developer-written pgm gets control, and can obtain the traceback?
What happens otherwise is that the user (who is not using a debugger, naturally) sees the console window flash and then disappear, with no indication for anyone of what error has occurred.
What happens otherwise is that the user (who is not using a debugger, naturally) sees the console window flash and then disappear, with no indication for anyone of what error has occurred.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Easiest fix is to use a small .BAT file to start the app.
So for example to start off APP.EXE you could create APP.BAT, containing:
APP.EXE
PAUSE
if APP.BAT resides in the same folder as APP.EXE, then double-clicking on APP.BAT will run APP.EXE. Then when it terminates (or crashes) the PAUSE command writes "Press any key to continue . . .", and the console duly sits there until you find the "any" key.
Fancier alternatives include creating a QuickWin app instead of a console app.
The .BAT file method can be extended to test the ERRORLEVEL flag so as to detect a normal termination and close immediately, and to PAUSE only when a crash (or other abnormal termination) has occurred.
Another obvious (to me at least) method is to start off your own Command prompt console, CD to the folder containing APP.exe, and start it running by typing APP. Then when it finishes, the console won't dissappear, and you can run it again, or do something else useful with it.

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