Question is only for Delphi- and Pascal-programmers.
Maybe, not only I have, when loop-variable was capricious. Example:
for i := 1 to n do
writeln('Spam-spam-spam');
"i" is going from n + 1 downto 2. Or in other order, unknown for me and debugger.
How can it cure?