Error Throwing In Calculator Code When Divided By '0'

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Mar 2006
Posts: 6
Reputation: saman is an unknown quantity at this point 
Solved Threads: 0
saman saman is offline Offline
Newbie Poster

Error Throwing In Calculator Code When Divided By '0'

 
0
  #1
Mar 30th, 2006
Plzzzzzzzzzzz Can Anyone Help Me Out Of This Problem By Tomorrow....lookin Forward For Any One So Nice To Help Me Up..saman
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 1,542
Reputation: tayspen is on a distinguished road 
Solved Threads: 98
Team Colleague
tayspen's Avatar
tayspen tayspen is offline Offline
<Insert title here>

Re: Error Throwing In Calculator Code When Divided By '0'

 
0
  #2
Mar 30th, 2006
Well, since you can't dive by zero, thats why its thorowing the error... You could just use try catch blocks. Or if you post your code, we could help you with better error handling.

If you use try catch block...

  1. try{
  2. //The calculator main code...Where the error is getting thrown
  3. }
  4. catch
  5. {
  6. MessageBox.Show("You divided by zero...");
  7. //Show the error
  8. }
Firefox
Ewido
Tune up windows
Get detailed system information
My Fixes

Member - Alliance of Security Analysis Professionals - Since 2006
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 45
Reputation: _r0ckbaer is an unknown quantity at this point 
Solved Threads: 7
_r0ckbaer's Avatar
_r0ckbaer _r0ckbaer is offline Offline
Light Poster

Re: Error Throwing In Calculator Code When Divided By '0'

 
0
  #3
Mar 30th, 2006
  1. // generate exception
  2. catch (DivideByZeroException e)
  3. {
  4. // handle exception
  5. }
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC