No. a
for to loop is fixed to the initial values.
You can use
repeat until or
while, though, if the count must change
[edit posts crossed Bart. Basically same answer]
Note actually this can be done, but it involves pointer trickery and
not recommended.E.g.
bad code:
{$mode delphi}{$H+}
var
i:integer;
k:integer = 10;
begin
for i := 0 to 10 do
begin
writeln(k);
inc(Pinteger(@k)^);
if k >= 20 then exit;
end;
end.
Never do that!!!(but it works
Partially )