Thema: Delphi TRY...EXCEPT-Fehler

Einzelnen Beitrag anzeigen

simlei

Registriert seit: 23. Nov 2005
119 Beiträge
 
Delphi 7 Professional
 
#1

TRY...EXCEPT-Fehler

  Alt 2. Aug 2007, 15:08
Ich hatte wieder etwas mahcen wollen wo gerne Fehlerchen auftreten. früher hatte ich einmal zum abfangen folgende Konstruktion verwendet:

Delphi-Quellcode:
try
    ShowMessage('BLUB');
except
    on E: Exception do ErrorDialog(E.Message, E.HelpContext);
end;
aber nicht einmal diese Beispiel, was so auch in der Delphi-Hilfe angegeben ist:

Zitat:
An exception handler can specify an identifier before the name of the exception class. This declares the identifier to represent the exception object during execution of the statement that follows on...do. The scope of the identifier is limited to that statement. For example,

try
...
except
on E: Exception do ErrorDialog(E.Message, E.HelpContext);
end;
funktioniert, es kommt: "Class Type required". Was zu tun?
  Mit Zitat antworten Zitat