下面两个函数的作用是等效的。
function DoSomething(aInteger: integer): string;
begin
if aInteger < 0 then
begin
Exit(‘Negative’);
end;
Result := ‘Positive’;
end;
function DoSomething(aInteger: integer): string;
begin
if aInteger < 0 then
begin
Result := ‘Negative’;
Exit;
end;
Result := ‘Positive’;
end;