[转载]Delphi 2009 (Tiburon) 新特性之 Exit 函数的新用法

下面的两个函数起到的作用是一样的 [转载]Delphi <wbr>2009 <wbr>(Tiburon) <wbr>新特性之 <wbr>Exit <wbr>函数的新用法[转载]Delphi <wbr>2009 <wbr>(Tiburon) <wbr>新特性之 <wbr>Exit <wbr>函数的新用法

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
posted @ 2013-03-29 23:23  Wishmeluck  阅读(154)  评论(0编辑  收藏  举报