|
-
January 17th, 2003, 04:05 AM
#1
ms dos help
i cant find anyware better to place this so i put it here. how do u stop windows from closing a dos box. i hav some dos programs i need to run and it opens them then closes them really quick befor i can doo anything. is there a way to turn this off or am i sol?
-
January 17th, 2003, 04:08 AM
#2
Try running them from a command prompt.
Or, create a script and put a couple of pause statements in there.
Quitmzilla is a firefox extension that gives you stats on how long you have quit smoking, how much money you\'ve saved, how much you haven\'t smoked and recent milestones. Very helpful for people who quit smoking and used to smoke at their computers... Helps out with the urges.
-
January 17th, 2003, 04:14 AM
#3
start them from a command prompt. that is start a dos window (start>>run>>command) now navigate to the folder the game is in (c:\games\) and just type the name of the main exe. or bat file (mario)
there's really many ways to do this. give more info like the os your using what games were talking about etc
Bukhari:V3B48N826 “The Prophet said, ‘Isn’t the witness of a woman equal to half of that of a man?’ The women said, ‘Yes.’ He said, ‘This is because of the deficiency of a woman’s mind.’”
-
January 17th, 2003, 04:17 AM
#4
im on xp and into c++ and some of the things i want to try i need the box to stay open.
-
January 17th, 2003, 04:22 AM
#5
same thing man. if you start a program from within dos the dos window stays open after the program finnishes. what compiler allot of the windows compilers have an option to open a dos prompt for this purpose.
Bukhari:V3B48N826 “The Prophet said, ‘Isn’t the witness of a woman equal to half of that of a man?’ The women said, ‘Yes.’ He said, ‘This is because of the deficiency of a woman’s mind.’”
-
January 17th, 2003, 04:25 AM
#6
-
January 17th, 2003, 04:36 AM
#7
http://www.geocities.com/uniqueness_template/
Method 1 - Scaffolding:
Add the following code before any return statement in main() or any exit() or abort() statement (in any function):
/* Scaffolding code for testing purposes */
cin.ignore(256, '\n');
cout << "Press ENTER to continue..." << endl;
cin.get();
/* End Scaffolding */
This will give you a chance to view any output before the program terminates and the window closes.
Method 2 - Command-prompt:
Alternatively, instead of using Dev-C++ to invoke your program, you can just open an MS-DOS Prompt, go to the directory where your program was compiled (i.e. where you saved the project) and enter the program name (along with any parameters). The command-prompt window will not close when the program terminates.
For what it's worth, I use the command-line method.
+=+=+=+=+=+=+=+=+=+
try
system(pause)
before return
you could of course use the gcc that bloodshed bases their product on from the command line and not have to switch back and forth.
gcc -o my.exe my.cpp
Bukhari:V3B48N826 “The Prophet said, ‘Isn’t the witness of a woman equal to half of that of a man?’ The women said, ‘Yes.’ He said, ‘This is because of the deficiency of a woman’s mind.’”
-
January 17th, 2003, 04:43 AM
#8
Tedob, in my opinion, has a good method with his scaffolding code. I use something like this in my programs, though in a slightly different way. I do the following:
Code:
#include statements
#define DEBUG
function prototypes
int main()
{
blah blah
#ifdef DEBUG
/* Insert scaffolding statements here */
#endif
blah blah
}
The advantage to doing this, once you are satsified with your program and no longer need the scaffolding statements, you can simply comment out the #define DEBUG line and they will no longer appear. I use this often because I set up debugging statements throughout my programs (temporary couts of variables, memory addresses, etc.), which I may want to use again if I decide to go back and modify my program. With the #define at the top, you will never have to remove the statements or comment them all out when you don't need them anymore... you just have to comment out the one line and your set. Think of it kind of like a global constant, once it's set, it doesn't change, but you can access it as much or as little as you want.
AJ
-
January 17th, 2003, 05:28 AM
#9
thanks all that really helped
-
January 17th, 2003, 06:35 AM
#10
the only way I can think of is from as already stated[quote command prompt[/quote]
that will do the job hehe! Running from the IDE of C++ will bring U back to its IDE when code has complete running
Don't U love the power cooooodddddddding
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|