下面的两个函数起到的作用是一样的
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;
文章出处:http://blogs.codegear.com/nickhodges/2008/07/22/39079