473,503 Members | 11,281 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Inserting Breakpoint at Runtime

I need to loop through a method 599 times, then break at the 600th loop in
the debugger.

Can I do that in code?

--
Regards,

Fred Chateau
http://hotelmotelnow.com
Jun 5 '07 #1
4 1967
Yup, conditional break :
type a boolean expression such as "i == 600" on the breakpoint (visual
studio 2005)
>I need to loop through a method 599 times, then break at the 600th loop in
the debugger.

Can I do that in code?

--
Regards,

Fred Chateau
http://hotelmotelnow.com

Jun 5 '07 #2
On Tue, 05 Jun 2007 09:37:34 -0700, Fred Chateau
<we*******@hotelmotelnow.comwrote:
I need to loop through a method 599 times, then break at the 600th loop
in
the debugger.

Can I do that in code?
You can write code that checks your loop counter and then calls
Debugger.Break(). Or you can simply set a conditional breakpoint in the
debugger, that checks the loop counter and only breaks at a specific line
when the counter matches the condition you specify.

Pete
Jun 5 '07 #3
You can customize the breakpoint by right clicking on the red dot
Jun 5 '07 #4

"Fred Chateau" <we*******@hotelmotelnow.comwrote in message
news:Oy**************@TK2MSFTNGP04.phx.gbl...
>I need to loop through a method 599 times, then break at the 600th loop in
the debugger.

Can I do that in code?
if (i == 600) global::System.Diagnostics.Debugger.Break();
>
--
Regards,

Fred Chateau
http://hotelmotelnow.com


Jun 5 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2419
by: Marko Poutiainen | last post by:
Situation: We had to make our SQLServer 2000 database multi-lingual. That is, certain things (such as product names) in the database should be shown in the language the user is using (Finnish,...
1
7446
by: Mike | last post by:
Can someone please tell me why this code (it is a function that has a parameter xmlstring: Dim objWebRequest As HttpWebRequest Dim oRequest As WebRequest objWebRequest =...
1
1954
by: manish | last post by:
Hi, I am a fresher in the programming field i.e although I have done programming at the basic level but at professional level I am very new and I am facing many problems. These probllems are...
3
6832
by: Joachim Klassen | last post by:
Hi all, first apologies if this question looks the same as another one I recently posted - its a different thing but for the same szenario:-). We are having performance problems when...
7
1812
by: AC [MVP MCMS] | last post by:
Wierd situation here. Running ASP.NET 1.1 on Win2003. I have to manually attach the debugger to a process in order to debug. So I set a breakpoint in an obvious place (like within the Page.Load...
5
1193
by: MLH | last post by:
Will it screw me up in a runtime rollout? If I forget about and leave a breakpoint set in A97, encrypte it, then compile it to an mde and roll it out in a runtime environment - will the app...
0
3171
by: noleander | last post by:
Hi. Ive been using Visual C++ for two years on an application. The application is one solution, containing 10 projects. 9 of the projects build libraries (*.lib). I've been debugging the...
4
5514
by: TC | last post by:
When I try to debug my code, Visual Studio is skipping my breakpoints. At runtime, the solid red circle becomes only the outline of a circle, and if I hover over the breakpoint I see the message...
6
1612
by: Bruce | last post by:
I have a reference assembly that I wrote. The assembly can throw exceptions. I am handling these exceptions but, when running my code from VB, VB still insists on setting a breakpoint where the...
0
7207
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
7095
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...
1
7015
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...
0
7470
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...
0
5602
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1523
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
749
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
403
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.