Odd Question
In VB.NET
I'm testing writing with console.write
How can I have command window pause with "Press any key to continue" phrase? Right now, as soon as my code finishes writing, command window disappears before I can examine the output.
Yeah, I know it's stupid but ... help!
[308 byte] By [
jmurdock] at [2007-11-11 8:35:00]

# 1 Re: Odd Question
If you use "Start Without Debugging" from Visual Studio's Debug menu, the system will automatically generate a "Press a key..." message after your program concludes.
Alternatively, you may use Console.ReadLine to wait for the user to press the Enter key.
# 3 Re: Odd Question
Or, for The Genuine Article(tm)
Dim nPid as Integer
nPid = Shell("pause")
This returns a "file not found" for me. Might have something to do with the path...
I would just use the ReadLine approach... it's pretty common... it all depends on the results you want though...
# 4 Re: Odd Question
Meh, it was just a suggestion of trying something along those lines. Being from a C background I know
system("pause");
would do that so I was guessing something similar in VB. Oh well :D
Just make sure you let your end user know (if it's going out to end users) that the program is waiting for input, otherwise they'll think it's crashed. It may sound obvious but I can't count the number of times I've forgotten to do the same and ended up with EUs complaining... :p
cmn_ at 2007-11-11 21:50:15 >
