Flat Spin
codemonkey
Posts: 38
I've run into the situation where setting a byte in an array to zero seems to clear out
the index. I've been beating my head way too long. What am i doing wrong? I
can't get it to happen when i try to isolate it, but i've included the pertinent code
here.
(The lines that have <== on them are extra statements to work around the problem;
the <== doesn't actually appear in the real code, just this post. The one "offending"
line of code has an uppercase comment just for this post)
Dat
ThirteenString byte (13)
gActiveSpeed long·
<snip>
· speedCalc(gActiveSpeed, 1, @ThirteenString)
<snip>
PUB speedCalc(speed, decplaces, xere) | i, j, m
<snip>·<== up until this point, evocations of i++ and xere[noparse][[/noparse]i++] work just fine
· m := i <==
· xere[noparse][[/noparse]i++] := 0· 'Terminating null <== THIS STATEMENT SETS i TO 0
· i := m <==
· i++ <==
<snip> <= and after this point, no problems
the index. I've been beating my head way too long. What am i doing wrong? I
can't get it to happen when i try to isolate it, but i've included the pertinent code
here.
(The lines that have <== on them are extra statements to work around the problem;
the <== doesn't actually appear in the real code, just this post. The one "offending"
line of code has an uppercase comment just for this post)
Dat
ThirteenString byte (13)
gActiveSpeed long·
<snip>
· speedCalc(gActiveSpeed, 1, @ThirteenString)
<snip>
PUB speedCalc(speed, decplaces, xere) | i, j, m
<snip>·<== up until this point, evocations of i++ and xere[noparse][[/noparse]i++] work just fine
· m := i <==
· xere[noparse][[/noparse]i++] := 0· 'Terminating null <== THIS STATEMENT SETS i TO 0
· i := m <==
· i++ <==
<snip> <= and after this point, no problems
Comments