| View previous topic :: View next topic |
| Author |
Message |
D Guest
|
Posted: Fri Jul 22, 2005 9:28 pm Post subject: Exception Handling - Whats going on here? |
|
|
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
|
|
| Back to top |
|
 |
D Guest
|
Posted: Fri Jul 22, 2005 11:37 pm Post subject: Re: Exception Handling - Whats going on here? |
|
|
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 |
|
 |
|