The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages - More
> Delphi Programming
|
Operation Aborted Exception
Discuss Operation Aborted Exception in the Delphi Programming forum on Dev Shed. Operation Aborted Exception Delphi Programming forum discussing Delphi related topics including Kylix, C++ Builder, and more. Delphi is a high-performance language, originally based on the PASCAL language.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

March 12th, 2013, 10:43 AM
|
|
Registered User
|
|
Join Date: Jul 2012
Posts: 28
Time spent in forums: 10 h 52 m 57 sec
Reputation Power: 0
|
|
|
Operation Aborted Exception
In the following code, i got an access violation error, while choosing the option 'mrCancel'. The code is as follows,
case VerifySaveChanges of
mrYes: InvokeSave;
mrNo: Cancel;
mrCancel: Abort;
end;
By using try.. Except, i got the exception.
Exception Name :'OPERATION ABORTED'.
How to resolve this ?
Thanks in advance.
|

March 12th, 2013, 11:42 AM
|
|
Contributing User
|
|
Join Date: Jan 2006
Location: Carlsbad, CA
|
|
|
OPERATION ABORTED
Is not an access violation, it is an exception that you raised by calling
Abort;
If you check the help file you will see that abort simply raises a silent exception.
i.e. an exception that does not produce the default exception dialog.
Clive
|

March 13th, 2013, 01:49 AM
|
|
Registered User
|
|
Join Date: Jul 2012
Posts: 28
Time spent in forums: 10 h 52 m 57 sec
Reputation Power: 0
|
|
Quote: | Originally Posted by clivew OPERATION ABORTED
Is not an access violation, it is an exception that you raised by calling
Abort;
If you check the help file you will see that abort simply raises a silent exception.
i.e. an exception that does not produce the default exception dialog.
Clive |
Thanks for the reply.
Actually this particular code taken care of refreshing dataset, will execute only in two scenarios.
scenario 1 : Pressing F5
scenario 2 : Using shortcut key ( Ctrl + f )
For pressing f5, its working fine as u said the 'Silent exception' occurs. In second scenario alone it returns an access violation.
What would be the prob ?
|

March 13th, 2013, 06:13 PM
|
|
Contributing User
|
|
Join Date: Jan 2006
Location: Carlsbad, CA
|
|
Not sure how you expect us to help if you do not post the relevant code.
Your original post says nothing about F5 or (Ctrl + f), the code behind them or
the context in which they are called. It only references the coded
response of OPERATION ABORTED.
Clive
|

March 15th, 2013, 12:53 AM
|
|
Registered User
|
|
Join Date: Jul 2012
Posts: 28
Time spent in forums: 10 h 52 m 57 sec
Reputation Power: 0
|
|
Quote: | Originally Posted by clivew Not sure how you expect us to help if you do not post the relevant code.
Your original post says nothing about F5 or (Ctrl + f), the code behind them or
the context in which they are called. It only references the coded
response of OPERATION ABORTED.
Clive |
Sorry for the incomplete data.
Code for Shorcut [Ctrl + F] is here as follows,
procedure HandleMaintNext;
begin
MoveBy(1);
end;
function MoveBy(Distance: Integer): Integer;
begin
CheckDS;
CheckModified;
//
// Additional Codes
//
end;
procedure CheckModified;
begin
if assigned(FDM) then begin
case VerifySaveChanges of
mrYes: InvokeSave;
mrNo: Cancel;
mrCancel: Abort; // Access violation occurs in this piece
end;
end;
end;
I hope it would be sufficient to trace out the prob.
Thanks in advance.
|

March 15th, 2013, 01:16 AM
|
|
Contributing User
|
|
Join Date: Jan 2006
Location: Carlsbad, CA
|
|
|
What is the code for CheckDS?
What is the code for VerifySaveChanges?
Are you sure FDM is actually assigned (as oppose to simply not nil)?
Delphi naming conventions would indicate that FDM is a private field of a class.
If that is true, you should not be accessing it from a procedure that is not a method of the same class.
[ALSO]
What is the code for mrYes (InvokeSave) and mrCancel (Cancel)?
It would seem that you are doing something in both methods that avoids the AV.
Clive
Last edited by clivew : March 15th, 2013 at 01:23 AM.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|