<p>Am 18.06.2014 04:55 schrieb "Jim Leonard" <<a href="mailto:trixter@oldskool.org">trixter@oldskool.org</a>>:<br>
><br>
> The error is because FreePascal optimizes loops wherever it can, and trying to modify the loop variable would break under that optimization.<br>
><br>
> While you could enable compilation flags to make things more TP compatible, looking at the code, I can see that the 'counter:=1' is just an early termination clause.  If the variable 'counter' isn't needed after that section, you could replace that line with 'break' which would exit the loop immediately (which is what the code does now).</p>

<p>One shouldn't assume anything about the loop variable after the execution of the loop anyway *except* the loop was left using Break or Goto.</p>
<p>Regards,<br>
Sven</p>