Solved

handle my own exeption

Posted on 2004-08-10
3
212 Views
Last Modified: 2012-05-05
i created my own exeption in a function:
 myOwnException is inherited from class (EAbort);
 the command i wrote is: " raise myOwnException.Create('my exeption');"
my problem: i want to continue with the program after handeling the exeption when i
return to the mothers function.
0
Comment
Question by:mars_r
3 Comments
 
LVL 7

Expert Comment

by:sftweng
ID: 11761751
Doesn't
 
try
  {some code}
except
  {handle the exception}
end;
{more code}

work?
0
 
LVL 7

Accepted Solution

by:
LRHGuy earned 250 total points
ID: 11761761
You'll need to use a try..except block around the call to your function:


Try
   CallMyFunction
except
  {handle any exceptions}
end;
{program continues here}

If you want to handle only YOUR exception:

Try
  CallMyFunction
except
  on myownexception do
     Message('Oops!');
end;
0
 
LVL 12

Expert Comment

by:Ivanov_G
ID: 11762000
type
  myOwnException = class(Exception)

...

try

except
  on E: MyOwnException do
    begin
      ShowMessage(E.Message);
      Exit;
    end;
end;
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now