NO

Author Topic: how to disable 'Press any key to continue...' in console program  (Read 13556 times)

bullygram

  • Guest
how to disable 'Press any key to continue...' in console program
« 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? ??? ???

CommonTater

  • Guest
Re: how to disable 'Press any key to continue...' in console program
« Reply #1 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.

bullygram

  • Guest
Re: how to disable 'Press any key to continue...' in console program
« Reply #2 on: November 27, 2010, 03:36:13 AM »
tankz CommonTater

MirekCZ

  • Guest
Re: how to disable 'Press any key to continue...' in console program
« Reply #3 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.

CommonTater

  • Guest
Re: how to disable 'Press any key to continue...' in console program
« Reply #4 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. 


Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2091
Re: how to disable 'Press any key to continue...' in console program
« Reply #5 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)
May the source be with you

CommonTater

  • Guest
Re: how to disable 'Press any key to continue...' in console program
« Reply #6 on: May 27, 2011, 06:10:18 AM »
Took me a minute to figure out where the /k came from...

Nice.



Offline AlexN

  • Global Moderator
  • Member
  • *****
  • Posts: 394
    • Alex's Link Sammlung
Re: how to disable 'Press any key to continue...' in console program
« Reply #7 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.
best regards
 Alex ;)

CommonTater

  • Guest
Re: how to disable 'Press any key to continue...' in console program
« Reply #8 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...