473,606 Members | 2,200 Online
Bytes | Software Development & Data Engineering Community
+ 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.Readlin e();
Dec 29 '07 #1
2 1664
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
1881
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 to be perfect. For example, I'd be happy with something where there was at most one pause per second, each pause was less than .2 seconds, and half the process's memory was inaccessible to the application due to garbage collection management It...
7
4534
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 printing both lines with no pause between. Can someone please explain why it behaves that way. I know in the case of "setTimeout" the only thing affected is the function, etc. appearing as "setTimeout" arguments. But, this is just straight code. ...
1
1738
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 occur. I have done this with re-defining document.onKeydown. This works wonderfully, with one exception. When the end user is typing in a standard input field, with simple text, the input will "pause". For example, as I am writting this the echo...
11
39874
by: Paminu | last post by:
Is there something like system("PAUSE") for linux?
8
36438
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 seems to work. But I have no clue how to pause/suspend the process. As far as I can see the Process class doesn't offer anything for this. So it's probably the thread the process is running on that should be suspended or put to sleep. But just...
14
9308
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 page loads, and I think this is preventing the cookie from being written. I need the code to pause, then in 30 seconds write the cookie..... anyone know if this can be done? TY jason shohet
2
2268
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, President eSolTec, Inc. a 501(C)(3) organization MS Authorized MAR looking for used laptops for developmentally disabled.
6
4045
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 using indy sockets, and can send information ok
16
2810
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. -- Kapteyn's Star
0
7951
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8430
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8094
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8305
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5966
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5465
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2448
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 we have to send another system
1
1553
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1296
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.