03-30-2011, 08:35 AM
Darkstar Wrote:This works:This is related to the ZX Basic to have "Dynamic" evaluation on each pass. In your loop:
Code:For i = AttrAddress to AttrAddress + NumberOfCells - 1
Poke i, AttrColor
Next i
This does not:
Code:For AttrAddress = AttrAddress to AttrAddress + NumberOfCells - 1
Poke AttrAddress, AttrColor
Next AttrAddress
This would work in other dialects.
Thanks,
Darkstar
Code:
For i = i to i + N - 1
Poke i, AttrColor
Next i
At the moment, the only way to fix this is:
Code:
LET z = i + N - 1
For i = i to z
Poke i, AttrColor
Next i
Which produces the expected behavior. I'm thinking in fixing this in an more efficient manner, so the user can choose dynamic or static FOR loops with a #pragma directive, and let FOR to be static by default for compatibility's sake. What do you think?