Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Resume Error

Posted on 1999-07-13
2
Medium Priority
?
224 Views
Last Modified: 2010-04-06
Is there a code that can resume running the program regardless of errors? One that can just run over the errors.
Like "On Error Resume Next" in VB.
0
Comment
Question by:jackjoker
[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
2 Comments
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 0 total points
ID: 1388321
Yes, they are called try...except blocks, like this:

try
  //Do some stuff
except
// We only get here is an exception is raised
  ShowMessage('Whoops');
end;
// Code continues here, with or without exception occuring.

Cheers,

Raymond.

0
 
LVL 2

Expert Comment

by:CalvinDay
ID: 1388322
type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  private
    procedure AppException(Sender: TObject; E: Exception);
  public
    { Public declarations }
  end;

procedure TfMain.FormCreate(Sender: TObject);
begin
  Application.OnException:=AppException;
end;

procedure TfMain.AppException(Sender: TObject; E:Exception);
begin
  // if you want to skip the errors, comment the next line.
  Application.ShowException(E);
end;
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

721 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