(Moderator)
Registriert seit: 6. Mai 2005
Ort: Berlin
4.956 Beiträge
Delphi 2007 Enterprise
|
Re: Objekterstellung im Konstruktor abbrechen
30. Sep 2005, 15:35
Wieso sind Exceptions nicht elegant?
Delphi-Quellcode:
Try
anObject := TMyObject.Create;
anOnject.DoSomeThing;
anObject.AProperty := FooBar
Except
Showmessage('Das Objekt konnte nicht erzeugt werden')
End;
"Wenn ist das Nunstruck git und Slotermeyer? Ja! Beiherhund das Oder die Flipperwaldt gersput!"
(Monty Python "Joke Warefare")
|