 |
 |
Just finished writing an app.
|
 |
|
 |
|
Senior User
Join Date: Feb 2001
Location: Ny,Ny,USA
Status:
Offline
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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.
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|