User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C# section within the Software Development category of DaniWeb, a massive community of 391,548 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,533 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C# advertiser:
Views: 2298 | Replies: 2
Reply
Join Date: Mar 2006
Posts: 6
Reputation: saman is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
saman saman is offline Offline
Newbie Poster

Help Error Throwing In Calculator Code When Divided By '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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jul 2005
Location: FL.
Posts: 1,536
Reputation: tayspen is on a distinguished road 
Rep Power: 7
Solved Threads: 98
Colleague
tayspen's Avatar
tayspen tayspen is offline Offline
<Insert title here>

Re: Error Throwing In Calculator Code When Divided By '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...

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

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

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

  #3  
Mar 30th, 2006
// generate exception
catch (DivideByZeroException e) 
{
   // handle exception
}
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb C# Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the C# Forum

All times are GMT -4. The time now is 9:05 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC