The watch problem is often the cause, since anything done to the variable
during debugging is done on the real thing.
However, if this is really not the case, sounds like a debugger issue. Can
you reproduce this in a new project? Try deleting the dll and recompiling on
your existing project - I wonder if that will fix it.
"David Veeneman" <da****@nospam.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
No, I don't have any watch statements on the code. But I have discovered
that the problem only occurs when I step through the code. When I run it
without breakpoints, it behaves as it should. Any idea what's going on?
Thanks
David Veeneman
Foresight Systems
"Marina" <so*****@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl... Do you have a watch statement that does something with the 'i' variable?
That could be a likely cause. Does the program work correctly if run
without debugging?
"David Veeneman" <da****@nospam.com> wrote in message
news:Ow**************@TK2MSFTNGP09.phx.gbl...A project that I have been working on has stopped executing loops
correctly. I can add a simple loop to a class in the project, like this:
for (int i = 0; i < 5; i++)
{
Console.Write(i);
}
The 'for' line will execute, then the 'Console.Write()' line, and the
focus jumps to the 'i++' statement. However, the counter 'i' doesn't
increment-- it remains at zero after the 'i++' statement is executed.
The 'i < 5' still evaluates to true, but the program immediately exits
the loop, as if 'i' had reached 5.
Has anyone else come across anything like this? Any suggestions on what
it might be? Thanks
David Veeneman
Foresight Systems