BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Exception Handling - Whats going on here?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi ObjectPascal
View previous topic :: View next topic  
Author Message
D
Guest





PostPosted: Fri Jul 22, 2005 9:28 pm    Post subject: Exception Handling - Whats going on here? Reply with quote



During program execution the dividend and divisor are both 0.0 .
I thought I could catch this with EZeroDivide execption.

But I am getting an EInvalidOp execption.
Why is this not EZeroDivide?
Is it because the dividend is 0.0 .

Seems like I will have to test the dividend for 0.0 .
Don't want to.

What do you think?

TIA, D

try
TempFloat :=
TblBilldata.fieldByName('TOTALCOST').AsFloat /
TblBilldata.fieldByName('BKWHT').AsFloat;

TblBilldata.fieldByName('CPU').AsFloat :=
TblBilldata.fieldByName('TOTALCOST').AsFloat /
TblBilldata.fieldByName('BKWHT').AsFloat;
except
// - Allways had this
on EZeroDivide do
TblBilldata.fieldByName('CPU').AsFloat := 0.0;

// - Now have added this
on EInvalidOp do
TblBilldata.fieldByName('CPU').AsFloat := 0.0;
end;

Back to top
Riki Wiki
Guest





PostPosted: Fri Jul 22, 2005 10:42 pm    Post subject: Re: Exception Handling - Whats going on here? Reply with quote



On 22 Jul 2005 14:28:21 -0700, D wrote:

Quote:
What do you think?

Take a look here:
http://delphi.wikicities.com/wiki/Delphi_Newsgroups

Back to top
D
Guest





PostPosted: Fri Jul 22, 2005 11:37 pm    Post subject: Re: Exception Handling - Whats going on here? Reply with quote



I take it item #1 is your point? If so do you know of a way to post
directly to the borland newsgroups via my web browser.

Since my organization swiched to Exchange Server I can nolonger post to
newsgroups with programs like Outlook Express.

T, D.

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi ObjectPascal All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.