1

I guess the answer is 'no', but I decided to ask you guys :)

So, imagine i have the following code:

for (int i = 0; i < 1000; i++)
{
    // Do something.
}

Let's say I've put a breakpoint inside VS on the line where the first curly brace is ("{"). I can go through all iterations of the for loop one by one, but imagine I'm interested in a particular one, for example, the 700th one. The only intuitive way I can think of is to remove this breakpoint and put one inside a code snippet that goes like:

if (i == 700)
{
    // Add a breakpoint here.
}

So, my question is whether there is a better way to achieve this task? :)

Yulian
  • 6,262
  • 10
  • 65
  • 92
  • 1
    @rene it *is* the feature that is needed, but to find that question, you need to know the feature exists and how it's called. – Hans Kesting May 28 '14 at 11:28

1 Answers1

2

Use conditional breakpoints and set the condition to i==700.

See "How to set conditional breakpoints in Visual Studio?"

Community
  • 1
  • 1
Nick
  • 25,026
  • 7
  • 51
  • 83