[fpc-pascal] Illegal counter variable?
greim at schleibinger.com
Mon Sep 9 19:15:28 CEST 2019
AFAIK these is the standard behavior since the first PASCAL versions.
We must not change it. It prevents a lot of side effects, and PASCAL is NOT C without brackets!
Use while or repeat instead!
>From Niklaus Wirths last 2004 Oberon manual:
t "It is recommended that the for statement be used in simple cases only; in particular, no
components of the expressions determining the range must be affected by the repeated
statements, and, above all, the control variable itself must not be changed by the repeated
statements. The value of the control variable must be considered as undefined after the for
statement is terminated."
--- original message ---
On September 9, 2019, 5:20 PM GMT+2 martin at templot.com wrote:
On 09/09/2019 15:11, James Richters wrote:
>> If (I>86) And (I<95) then Continue;
>> What does continue do exactly? Loop back to the beginning of the for loop right away?
> Hi James,
> Yes in effect -- it jumps forward to the test at the end of a loop. Very
> See: https://www.freepascal.org/docs-html/rtl/system/continue.html
> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
--- end of original message ---
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-pascal