Break point conditional expression: When changed

  • Thread starter Thread starter SagaV9
  • Start date Start date
S

SagaV9

Guest
Hi all,

I am using VS 2015 with C# and Windows 10. I am looking into conditional breakpoints and came across a behavior that I do not understand. Here is the code that I put inside a button click event:

int iResult = 0;

for (int i = 0; i < 11; i++)
{
if (i % 3 == 0)
iResult++;
}

I put a break point on the line that increments iResult and configured the conditional break point as follows:

1615664.png

Given the above code, I expect the break point to stop the app when i is 0 and iResult is incremented from 0 to 1; however, this is not the case. The app stops when iResult is incremented from 1 to 2, that is, on the second time that iResult changes (and i is 3). Is there something I am not understanding about how this conditional break point works? Any feedback is appreciated. Thank you for your time. Saga





You can't take the sky from me

Continue reading...
 
Back
Top