digitalmars.D - Stoping VS2005 from closing the damn console window
- Andrej M. (12/12) Apr 09 2009 I'm trying to get VS 2005 to stop closing the command window when I'm ru...
- Steven Schveighoffer (7/24) Apr 09 2009 Try Thread.sleep(3600);
- Adam D. Ruppe (13/14) Apr 09 2009 Stick another Cin.get(); at the end of the code. That way, it will pause
- torhu (2/14) Apr 09 2009 Doesn't it wait for input if you just add an extra Cin.get() at the end?
- Denis Koroskin (2/19) Apr 09 2009 Try running your applications using Ctrl+F5, this should help.
- Kagamin (1/1) Apr 09 2009 cmd /K myprog.exe
- Andrej M (2/2) Apr 09 2009 Yeah it's Cin.get(); that did the trick.
I'm trying to get VS 2005 to stop closing the command window when I'm running examples from the "Learn to tango with D" book. (I'm using that VS plugin from Dsource.org) I've tried running the examples with and without debugging, but the command window still closes down rapidly. I've even tried using a function to wait for user input.. but that won't work either. I've no idea what's going on. Here's a peace of code I've tried: [code] import tango.io.Console; void main() { Cout ("What is your name? ") (); auto name = Cin.get(); Cout ("Hello ") (name).newline; } [/code]
Apr 09 2009
On Thu, 09 Apr 2009 12:53:12 -0400, Andrej M. <and.mitrovic hotmail.com> wrote:I'm trying to get VS 2005 to stop closing the command window when I'm running examples from the "Learn to tango with D" book. (I'm using that VS plugin from Dsource.org) I've tried running the examples with and without debugging, but the command window still closes down rapidly. I've even tried using a function to wait for user input.. but that won't work either. I've no idea what's going on. Here's a peace of code I've tried: [code] import tango.io.Console; void main() { Cout ("What is your name? ") (); auto name = Cin.get(); Cout ("Hello ") (name).newline; } [/code]Try Thread.sleep(3600); That will sleep for an hour :) Of course, you'll have to kill it to stop it. You can also always simply run cmd.exe and run it from the command line. -Steve
Apr 09 2009
On Thu, Apr 09, 2009 at 12:53:12PM -0400, Andrej M. wrote:I'm trying to get VS 2005 to stop closing the command window when I'm running examples from the "Learn to tango with D" book. (I'm using that VS plugin from Dsource.org)Stick another Cin.get(); at the end of the code. That way, it will pause for you to press another key before terminating, giving you a chance to look over the output. I think there is an option in the console window to keep it open too, somewhere in right click its taskbar icon, hit edit->properties and look under those tabs for the checkbox, but I'm not sure if that is actually there anymore. Just getting another line of user input at the end of the program will work though. -- Adam D. Ruppe http://arsdnet.net
Apr 09 2009
On 09.04.2009 18:53, Andrej M. wrote:I'm trying to get VS 2005 to stop closing the command window when I'm running examples from the "Learn to tango with D" book. (I'm using that VS plugin from Dsource.org) I've tried running the examples with and without debugging, but the command window still closes down rapidly. I've even tried using a function to wait for user input.. but that won't work either. I've no idea what's going on. Here's a peace of code I've tried: [code] import tango.io.Console; void main() { Cout ("What is your name? ") (); auto name = Cin.get(); Cout ("Hello ") (name).newline; } [/code]Doesn't it wait for input if you just add an extra Cin.get() at the end?
Apr 09 2009
On Thu, 09 Apr 2009 20:53:12 +0400, Andrej M. <and.mitrovic hotmail.com> wrote:I'm trying to get VS 2005 to stop closing the command window when I'm running examples from the "Learn to tango with D" book. (I'm using that VS plugin from Dsource.org) I've tried running the examples with and without debugging, but the command window still closes down rapidly. I've even tried using a function to wait for user input.. but that won't work either. I've no idea what's going on. Here's a peace of code I've tried: [code] import tango.io.Console; void main() { Cout ("What is your name? ") (); auto name = Cin.get(); Cout ("Hello ") (name).newline; } [/code]Try running your applications using Ctrl+F5, this should help.
Apr 09 2009
Yeah it's Cin.get(); that did the trick. Thanks everyone.
Apr 09 2009