Quote Originally Posted by richard View Post
if ByteCnt=2 how many times will it run through this for/next loop ?



FOR GP=0 to ByteCnt ' Clear array bytes 0 to ByteCnt
BytesIn[GP]=0
NEXT



when you set BytesIn[2] to 0 what var do you think will get clobbered


its not a Strange Variable Issue ... its a write to an out of bounds array index
Hmm I've changed the line as follows

FOR GP=0 to ByteCnt-1 ' Clear array bytes 0 to ByteCnt
BytesIn[GP]=0
NEXT
And it works as expected ... Thank you for your answer Richard ..

Now can you explain what happens when it tries to clear a nonexisting variable ? It clobbers my DAT variable next as it should not , yet somehow it does .. ?

I think there is something happening on the background that is out of my knowledge ..