Delphi Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreDelphi Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 12th, 2013, 10:43 AM
Murugavel Murugavel is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2012
Posts: 28 Murugavel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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.

Reply With Quote
  #2  
Old March 12th, 2013, 11:42 AM
clivew clivew is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2006
Location: Carlsbad, CA
Posts: 2,045 clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 2 h 37 m
Reputation Power: 382
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

Reply With Quote
  #3  
Old March 13th, 2013, 01:49 AM
Murugavel Murugavel is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2012
Posts: 28 Murugavel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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 ?

Reply With Quote
  #4  
Old March 13th, 2013, 06:13 PM
clivew clivew is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2006
Location: Carlsbad, CA
Posts: 2,045 clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 2 h 37 m
Reputation Power: 382
Quote:
What would be the prob ?

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

Reply With Quote
  #5  
Old March 15th, 2013, 12:53 AM
Murugavel Murugavel is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2012
Posts: 28 Murugavel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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.

Reply With Quote
  #6  
Old March 15th, 2013, 01:16 AM
clivew clivew is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2006
Location: Carlsbad, CA
Posts: 2,045 clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level)clivew User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 2 h 37 m
Reputation Power: 382
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreDelphi Programming > Operation Aborted Exception

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap