Einzelnen Beitrag anzeigen

PaulJr

Registriert seit: 9. Feb 2007
Ort: Stuttgart
66 Beiträge
 
#7

Re: Bubblen Exceptions nach oben durch einen try-finally-Blo

  Alt 11. Feb 2007, 22:15
Hallo DGL-luke,

man könnte dies z.B. so machen:
Delphi-Quellcode:
var
  SomeClas : TSomeClas;
Begin

try
  SomeClas := TSomeClas.Create;
 If SomeClas <> NIL then
 with SomeClas do
    try
      SomeMethod;
      SomeMethodThatThrows; //wirft Exception!
    finally
      Free;
    end;
except
  on E:Exception do
    ShowmEssage(E.Message);
end;

end;
Gruß

PaulJr.
  Mit Zitat antworten Zitat