I encountered a strange behavior when using the Continue procedure in a repeat statement. The simplified snippet:
program RepContinue;
{$APPTYPE CONSOLE}
{$R *.res}
var
i: Integer;
begin
i := 5;
repeat
Writeln(i);
Dec(i);
if i > 0 then
Continue;
until True;
Readln;
end.
It was expected that this program will print 5 numbers: "5 4 3 2 1". But in fact, it stops immediately after “5”.
Is it a compiler error, or is it the way it should be?