label
AfterLoops;
var
Array1, Array2: TArray<Integer>;
Value1, Value2: Integer;
FirstMatchValue: Integer;
begin
Array1 := [1, 2, 3];
Array2 := [2, 3, 4];
//no labeled break: leaving nested
//loops needs goto or a flag
FirstMatchValue := -1;
for Value1 in Array1 do
for Value2 in Array2 do
if Value1 = Value2 then
begin
FirstMatchValue := Value2;
goto AfterLoops;
end;
AfterLoops:
//firstMatchValue is 2
WriteLn(FirstMatchValue);
end.