473,480 Members | 1,836 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Pause When Done

2 New Member
I have a program I wrote. I compile it and run it but it closes once it is done how do I tell it to pause when done?

With C# language I wrote:

Console.Readline();
Dec 29 '07 #1
2 1655
xenoalien
2 New Member
K i figured it out... sorry for posting newb questions lol

system("PAUSE");
Dec 29 '07 #2
weaknessforcats
9,208 Recognized Expert Moderator Expert
K i figured it out... sorry for posting newb questions lol

system("PAUSE");
Nope, you didn;t figure it out. You added code to stop the problem. Now you have to remove the code before you sell it to customers. This is a bad idea.

The real problem is not understanding Visual Studio.NET. When tou start a program, there are two starts: Start and Start Without Debugging.

The reason for the two starts is that Visual Stusio.NET produces two kinds of builds: Debug and Release. Debug is the default.

A Debug build has code in it to operate your debugger.

Therefore, when you Start, your code just runs. Visual Studio sees that it is a Debug build abd assumes you have set the necessary breakpoints to stop it. A system("PAUSE") is not a breakpoint. It is, what is called in the business, a hack.

However, there is Start Without Debugging. In this case, Visual Studio is beinbg told that while this is a Debug build, you are not using your debugger. In this case, Visual Studio will pause at the end of main with:

Press any key to continue...

Remove the system("PAUSE") and Start Without Debugging.
Dec 30 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1846
by: Andrew | last post by:
When will .NET have a low-pause-time garbage collector A low-pause-time garbage collector would greatly improve .NET's ability to serve as a platform for soft real-time systems. It doesn't have...
7
4525
by: arajunk | last post by:
I was looking around for some code for a special purpose and found this. Seems it should print "here we go" , pause 5 seconds, print "now we are back". Instead, it pauses 5 seconds before...
1
1732
by: ericm | last post by:
Hello all, I am looking for a little guidence. I have written a page in which I am trying to identify when a function key (f1-f12) is pressed. When the key is pressed a pre-defined event will...
11
39848
by: Paminu | last post by:
Is there something like system("PAUSE") for linux?
8
36395
by: Wim | last post by:
My GUI application starts a process (a console program) when the user hits Play. I would like to add an option to pause that process. The code I've added to detect if the user hit pause/unpause...
14
9291
by: Jason Shohet | last post by:
I want a function to pause, then resume in 30 seconds. I know it sounds wierd... I have a situation that I need to write a cookie, but the user does not have rights to drive at the time the asp.net...
2
2255
by: eSolTec, Inc. 501(c)(3) | last post by:
Thank you in advance for any and all assistance. Is there a way to start, pause and resume a recurrsive search exactly where you left off, say in the registry programmatically? -- Michael Bragg,...
6
4024
by: Peted | last post by:
Hi wondering what is the best way to do this Need a user to click a button, that sends 3 or 4 string based commands via a TCP/ip socket link I can connect to the ip device no problems, am...
16
2794
by: Kapteyn's Star | last post by:
Hello all, I want a function to make the program pause for a few seconds but K&R have not listed anything for this i even looked in index. can anyone help? Thank you very much. --...
0
7054
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6918
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7102
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4798
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3000
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1310
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
570
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
199
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.