Am 18.06.2014 04:55 schrieb "Jim Leonard" <trix...@oldskool.org>:
>
> The error is because FreePascal optimizes loops wherever it can, and
trying to modify the loop variable would break under that optimization.
>
> 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).

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.

Regards,
Sven
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to