Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Applications > Just finished writing an app.

Just finished writing an app.
Thread Tools
Senior User
Join Date: Feb 2001
Location: Ny,Ny,USA
Status: Offline
Reply With Quote
Feb 10, 2004, 06:36 PM
 
Hey folks. Im pretty much done with this app. There is bug that I need to fix but you get the picture.

Check it out.

StatBook 1.0

Read this after you have checked out the APP.

If anyone can help me figure it out that would be great. The bug is when you click one of calculate buttons it calculates what you want but then it adds "nan" to the other total fields.

Anyone know why?

Thanks
i hate project managers.
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Feb 10, 2004, 07:19 PM
 
It means you've done a bad floating point calculation somewhere along the line (most likely due to division by zero in this case, I'd think). And I think this would be more appropriate in the Developer forum.
(Last edited by Chuckit; Feb 10, 2004 at 07:24 PM. )
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Senior User
Join Date: Feb 2001
Location: Ny,Ny,USA
Status: Offline
Reply With Quote
Feb 10, 2004, 07:25 PM
 
Originally posted by Chuckit:
It means you've done a bad floating point calculation somewhere along the line. And I think this would be more appropriate in the Developer forum.
Isnt this the Software Forum?

I dont think the calculations are wrong cause they all calculate correctly. What I think it is is that when you click any of the calculate buttons they are connected to the same class therefore it calculates all the fields, even if there is nothing in them. Thats why it returns a NAN for the ones with no data.

Could this be it?
i hate project managers.
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Feb 10, 2004, 11:18 PM
 
Originally posted by drainyoo:
Isnt this the Software Forum?
Yes, but you're asking for help with software development. The general user base doesn't even know what "NaN" means, much less what would cause it to appear in a text field. So the Developer forum would be the logical place to find people with the answer to your question.

I dont think the calculations are wrong cause they all calculate correctly. What I think it is is that when you click any of the calculate buttons they are connected to the same class therefore it calculates all the fields, even if there is nothing in them. Thats why it returns a NAN for the ones with no data.

Could this be it?
Yep. That's pretty much what I was thinking -- division by zero. I was just hurrying through my break at the time.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Senior User
Join Date: Feb 2001
Location: Ny,Ny,USA
Status: Offline
Reply With Quote
Feb 11, 2004, 01:03 PM
 
Originally posted by Chuckit:
Yes, but you're asking for help with software development. The general user base doesn't even know what "NaN" means, much less what would cause it to appear in a text field. So the Developer forum would be the logical place to find people with the answer to your question.


Yep. That's pretty much what I was thinking -- division by zero. I was just hurrying through my break at the time.
Yeah I understand but I was posting it for people to check out more than to get some help.

Anyways, how could I fix this?

I tried making seperate classes for each section, for example one for batting, one for pitching..etc.., but I keep getting errors when I do it that way. Could you help me? I could send you the source code or at least show you them.

Thanks.
i hate project managers.
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Feb 11, 2004, 02:33 PM
 
Originally posted by drainyoo:
Anyways, how could I fix this?
Two possibilities: Have the buttons call different methods in your controller, each of which does its own calculations and updates its own fields. Or you could give the "Calculate" buttons tags, have them all call the same method in your controller and switch calculations based on [sender tag].

In any case, you should check to make sure none of the fields you're using for a calculation is blank.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Senior User
Join Date: Feb 2001
Location: Ny,Ny,USA
Status: Offline
Reply With Quote
Feb 11, 2004, 02:37 PM
 
Originally posted by Chuckit:
Two possibilities: Have the buttons call different methods in your controller, each of which does its own calculations and updates its own fields. Or you could give the "Calculate" buttons tags, have them all call the same method in your controller and switch calculations based on [sender tag].

In any case, you should check to make sure none of the fields you're using for a calculation is blank.
Man I really wish I knew how to do this stuff.I literally started doing this this past weekend.

Thanks for the help. Ill see what I can do.
i hate project managers.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 10:24 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2