Delphi Exception.Create
function TForm1.aa: Boolean;
var
i:Integer;
begin
Result := True;
i := 10;
if i > 9 then
begin
Result := False;
raise Exception.Create('haha');
end
else
begin
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
try
if aa then
ShowMessage('sdfg')
else
ShowMessage('bb');
end;
finally
showmessage('yyyyy');
end;
先执行显示‘yyyy’在执行Exception.Create执行以后,将不执行后面的程序