Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

C# Programming

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

Yup, conditional break :
type a boolean expression such as "i == 600" on the breakpoint (visual
studio 2005)

On Tue, 05 Jun 2007 09:37:34 -0700, Fred Chateau  

<webmas@hotelmotelnow.com> wrote:
> 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

-----------------------------------------------Reply-----------------------------------------------

You can customize the breakpoint by right clicking on the red dot

-----------------------------------------------Reply-----------------------------------------------

"Fred Chateau" <webmas@hotelmotelnow.com> wrote in message

news:OyMTP$4pHHA.1244@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();

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc