Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

what is different between ctrl+F5(execution program) and F5(go)

Status
Not open for further replies.

baharengineer

Programmer
Jul 9, 2010
42
IR
when i run program with F5 out put print and after printing close window automatically but when i use ctrl+F5 i can view output and when press any key , the window is closed..

please tell me what is different of them

thanks
 
To all appearances you have Visual Studio (-like) IDE.

F5 key (Start Debugging) starts debugging run. The program runs until breakpoint or errror or exit occured. IDE closes program window after that.
You can see the window while you are DEBUG the program.

Ctrl-F5 key (Start Without Debugging) starts an usual run but IDE keeps program console window until sacramental "press any key to quit"...
 
now when i run program.exe from debug folder i cannot see this and the window close after printing output!

like when i run program with F5

then how can i see output ? i want execution program for my manager project! whit out need to compiler and via exe file

what can i do?
 
If you start the program from cmd line (outside the IDE) it's no matter what's a difference between F5 and Ctrl-F5.
Add these lines in the program:
Code:
character junkch
...
print *,'Press q then Enter to quit..."
read *,junkch
! then exit (stop or end program stmts)
In other words let an user closes cmd window.

Or better open cmd window and start the program by hands. Close the window after the program output inspection...
 
It might be compiler-specific (both gfortran and g95 handle it), but as far as I know, you don't even need "junkch".

Just this should work:

Code:
print *,'Press Enter to quit..."
read *,
! then exit (stop or end program stmts)


--------------------------------------
Background: Chemical engineer, familiar mostly with MATLAB, but now branching out into real programming.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top