Hi all,

I've been spending a few hours now (this is an euphemism, of course ) on trying to find out why the program I'm currently working on has his variables "changing" values without any obvious reason.

Let me explain.

In this first image, the green field shows correct values and the red one, the wrong values. Amazingly, the program works (by chance...) but the reported values by the SEROUT command are wrong (in the "red" case).

Name:  000545.png
Views: 484
Size:  7.2 KB



These values change depending on the placement of a few lines of code as you can see herunder.

Correct
Name:  OK_000543.png
Views: 340
Size:  10.8 KB

NOT Correct
Name:  NO_000544.png
Views: 332
Size:  10.9 KB


So, is there any scientific reason why my values change depending on the placement of the DEBUG (yellow frame) lines?

The variables Now and Prev are declared as BYTE and have respectively values 15 and 255 at program startup.

Thanks for any explanation that will stop me jump out of my window!!! Okay, I leave on the groundfloor...