Pelles C forum

Pelles C => General discussions => Topic started by: bullygram on November 26, 2010, 06:34:27 PM

Title: how to disable 'Press any key to continue...' in console program
Post by: bullygram on November 26, 2010, 06:34:27 PM
I am having a problem with pelles C. I am new to pelles c, before i was using dev c++.
i am doing a console program. And in the execution time, after the output is printed. I see an extra line printed  'Press any key to continue...'. How to disable it? ??? ???
Title: Re: how to disable 'Press any key to continue...' in console program
Post by: CommonTater on November 26, 2010, 07:02:50 PM
I am having a problem with pelles C. I am new to pelles c, before i was using dev c++.
i am doing a console program. And in the execution time, after the output is printed. I see an extra line printed  'Press any key to continue...'. How to disable it? ??? ???

Run the program ouside the IDE... 
That's something Pelle added to keep the console window open long enough to see the output.
Title: Re: how to disable 'Press any key to continue...' in console program
Post by: bullygram on November 27, 2010, 03:36:13 AM
tankz CommonTater
Title: Re: how to disable 'Press any key to continue...' in console program
Post by: MirekCZ on May 27, 2011, 12:41:42 AM
What about in the future version POIDE to give (for instance in menu Tools/option/...) edit/configurable box with specific parametr - command for calling to call console under just compilled executable. I think
   console command [cmd.exe %exe%  /p]
or anything else.
Title: Re: how to disable 'Press any key to continue...' in console program
Post by: CommonTater on May 27, 2011, 02:34:37 AM
You might want to try the "Open Command Shell" AddIn (See AddIns forum...) It will put a button on the toolbar that opens a command shell in your project directory so you can run it outside the IDE... also there is a command line flags option in Projects->Options->General that lets you set command line parameters when test running the app.

AddIns are very easy to install... just drop the appropriate DLL (32 or 64 bit per your OS) into the Pelles C/Bin/AddIns folder... then launch POIDE and under Tools->Configure->AddIns, enable it by checking the box next to it. 

Title: Re: how to disable 'Press any key to continue...' in console program
Post by: TimoVJL on May 27, 2011, 05:43:57 AM
Quote
console command [cmd.exe %exe%  /p]
Do you mean this:

Menu -> Tools -> Customize... -> Tools -> New tool

Menu text: Console command
Command: C:\Windows\System32\cmd.exe
Arguments: /k $(TargetPath)
Title: Re: how to disable 'Press any key to continue...' in console program
Post by: CommonTater on May 27, 2011, 06:10:18 AM
Took me a minute to figure out where the /k came from...

Nice.


Title: Re: how to disable 'Press any key to continue...' in console program
Post by: AlexN on May 28, 2011, 03:55:26 PM
Took me a minute to figure out where the /k came from...
With /k the window stays open after execution, with /c the window closes.
Title: Re: how to disable 'Press any key to continue...' in console program
Post by: CommonTater on May 28, 2011, 05:05:34 PM
Yeah... I know that now... but it took me a bit in Pelles help file to realize the /k was a CMD switch not something Pelle set up...

The attached works pretty nicely too...