Solved

handle my own exeption

Posted on 2004-08-10
3
219 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses
Course of the Month7 days, 1 hour left to enroll

622 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