Quantcast
Channel: MEL PICBASIC Forum
Viewing all articles
Browse latest Browse all 4787

Variables change depending on a SEROUT2 command placement in code

$
0
0
Hi all,

I've been spending a few hours now (this is an euphemism, of course :D) 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).

Attachment 8972



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

Correct
Attachment 8973

NOT Correct
Attachment 8974


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...:wink:
Attached Images
   

Viewing all articles
Browse latest Browse all 4787

Trending Articles