Page 1 of 1

exit(0) in Delphi?

Posted: 25 Nov 2005, 14:56
by UndaGrad
I want to jup out of a FOR loop once a certain condition is met. I've tried reassigning the loop control condition's value to one that stops the loop, but Delphi complains that I'm, '... trying to change a FORLOOP control...'.

So is there such a thing as a exit(0)?

Posted: 25 Nov 2005, 23:24
by Moses
Ever heard of a while loop?

Posted: 26 Nov 2005, 16:44
by UndaGrad
//never mind

Posted: 26 Feb 2006, 22:27
by PHR33K
or repeat... untill


like:

(just quickly done)

procedure whatever;
var
i : integer;
begin

i := 0;

repeat
begin
//statement here
inc(i);
until i = 10;

end;

end;
end.