function LoopJ: Integer;
var
J: integer;
begin
Result := -1; //default, no special attention needed
for J := 0 to 10 do
begin
if SomeCondition1 then
begin
Result := 0;
Exit; //break out of both loops, go to methodC
end;
if SomeCondition2 then
begin
Result := 1;
Exit; //break out j loop and skip methodB
end;
MethodA;
end;
end;
procedure LoopI;
var
I, Res: Integer;
begin
for I := 0 to 10 do
begin
Res := LoopJ;
case Res of
0: Exit;
1: Continue;
end;
MethodB;
//you can add other stuff here
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
LoopI;
MethodC
end;