|
swetha <swetha.bsharma@gmail.com> wrote in message <07d5c705-0a54-432c-bc86-b6b1581909de@u16g2000pru.googlegroups.com>...
> On Nov 26, 3:34?am, "Todd " <aeroan...@gmail.com> wrote:
> > I seem to be getting some unexpected results in a program that I'm modifying (I'm not the original author).
> >
> > I see three different things happen:
> > 1. The program crashes when I run it normally. ?
> > 2. When I insert a breakpoint (with no other changes) the program will run, but provide incorrect results.
> > 3. If I step through the part of the code that I think has the problem line-by-line everything works fine and the program produces correct results.
> >
> > I've seen something like this happen before when trying to talk to some external device, or using ActiveX. ?This is usually corrected by inserting a pause to correct any asynchronous behavior...unfortunately, that doesn't seem to be happening here. I'm processing data that is on my local machine (as opposed to the network, which could introduce some lag), and no external programs or devices are being called.
> >
> > The program is too big and complicated to post here, but I was wondering if anyone else has seen anything like this before? ?What are some things I could try since the problem goes away in debug mode?
>
> Hi,
> Even i am experiencing the same problem.Have you got any solutions?
> -swetha
The only thing I've got so far is that it seems like there is a variable that is not getting cleared (lots of sloppy use of global variables). As a result a while loop is being executed too many times. Again, I'm not sure why this would change when I'm in debug mode. If I rewrite the while loop as a for loop the program does not crash, but produces incorrect results.
Can you tell me something about how your program is structured?
My error is occurring in a while loop that is in a nested function. The function that calls the nested function is inside a for loop which is inside a while loop. I'm thinking the convoluted structure of the program has something to do with it. I'm curious what the commonalities are between your program and mine.
|