Reputation: 612
When my windows console app compiled with ghc going to it's end, the console window instantly closes. That is good sometimes, but not very good when I want to read some text output from it. So, now I adding this ugly code to my app:
main =
do
...HERE IS THE CODE ...
putStrLn " $$ Every thing have passed well $$ /n Press Enter "
_ <- getLine
return ()
And this is quite ugly, and more, when some error crashes my app, the console window closes. An other way around to run program in 'cmd' console, but it is not comfortable sometimes. Is there any good looking and convenient way for handling program output?
Upvotes: 3
Views: 1307
Reputation: 62808
You could just write a trivial shell script like
MyApp.exe PAUSE
Save that as RunIt.cmd
or something, and then double-click that to run the application. It will open a console window, and wait for you to press any key before the window shuts, regardless of what Haskell does.
Upvotes: 8