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

x
?
Solved

How to cancel an action

Posted on 2001-06-14
5
Medium Priority
?
1,023 Views
Last Modified: 2010-04-06
In the standard dbnavigator bar (Delphi 5) there is an event called 'BeforeAction'. How can I cancel or abort the action (any of them) from within this event?

Thanks !

AJ
0
Comment
Question by:ajgonzalezm
[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
5 Comments
 
LVL 12

Expert Comment

by:rwilson032697
ID: 6193867
The quickest and easiest way is to call the 'Abort' procedure.

Cheers,

Raymond.
0
 
LVL 44

Accepted Solution

by:
CrazyOne earned 200 total points
ID: 6193869
SysUtils.Abort;

Delphi Help
Ends the current process without reporting an error.

Unit

Sysutils

Category

flow control routines

procedure Abort;

Description

Use Abort to escape from an execution path without reporting an error.

Abort raises a special "silent exception" (EAbort), which operates like any other exception, but does not display an error message to the end user.  Abort redirects execution to the end of the last try .. finally block.
0
 
LVL 1

Expert Comment

by:Greyman
ID: 6194027
Or, if you are logging your exceptions, you can be really fancy and do this:

raise EAbort.Create('Operation cancelled by user');

The user won't see that text, but the exception handling system will :)
0
 

Author Comment

by:ajgonzalezm
ID: 6195409
CrazyOne: We were using abort alone and it didn't work that way. Using SysUtils.Abort solved the problem.

Thanks a lot. (to all of you)

Regards,


AJ
0
 
LVL 44

Expert Comment

by:CrazyOne
ID: 6195459
Yeah I was getting compiling errors just using Abort and to this day I don't know why so I have gotten use to doing SysUtils.Abort instead. Glad we were able to help you.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
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

730 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