Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi Exception handling (https://www.delphipraxis.net/26569-exception-handling.html)

day 25. Jul 2004 16:57


Exception handling
 
Hallo

Wie finde ich heraus welche exception eine methode wirft.
z.B. welche exception wirft folgende zeile wenn das file nicht vorhanden ist

TXMLDocument.Create(fileName); (ist Komponente TXMLDocument)

danke

Ultimator 25. Jul 2004 17:26

Re: Exception handling
 
Probier das mal aus:
Delphi-Quellcode:
try
TXMLDocument.Create(fileName);
except
 on E: Exception do ShowMessage('Es ist ein ' + E.ClassName + ' aufgetreten! '+
 E.Message);
end;


Alle Zeitangaben in WEZ +1. Es ist jetzt 01:37 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz