http://calcg.org/newlogo2.png Not Logged in.
Login | Register

General Discussion Board \ Calculator Discussion \ 86 Programming question

Click here to log in (you must be logged in to post comments).

AuthorComment
foxsly
Probe
Posted: 22 Aug 2003
09:06 GMT
Total Posts: 2
I'm trying to write a program that helps me evaluate fantasy football players.

The code goes like this:

:"VQB">VQB
:"Pos">P
:"TDS">TDS
:"Games">G
:"Age">A
:"TeamValue">TV
:"Exp">E
:"Yards">Y
:Input "Pos",P
:Input "TDS",TDS
:Input "Exp",E
:Input "Games",G
:Input "Age",A
:Input "TeamValue",TV
:Input "Yards",Y
:If P=1
:Then
:(((TDS85)+(G/4)+((A/3)+E)+(Y/10)/TV))>VQB
:End
: Disp "QB Rating:",VQB

where > is the sto-> function, VQB is quarterback value.

when it runs, everything works until the points at the end where it shows the results. this shows as:
QB Rating: VQB
instead of the rating. I think this has something to do with equation variables and string variables, and any help would be appreciated.


[Edited by foxsly on 22-Aug-03 18:07]
foxsly
Probe
Posted: 22 Aug 2003
09:19 GMT
Total Posts: 2
I've now changed it so that the code goes like this:

:"Pos">P
:"TDS">TDS
:"Games">G
:"Age">A
:"TeamValue">TV
:"Exp">E
:"Yards">Y
:Input "Pos",P
:Input "TDS",TDS
:Input "Exp",E
:Input "Games",G
:Input "Age",A
:Input "TeamValue",TV
:Input "Yards",Y
:If P=1
:Then
:VQB=(((TDS85)+(G/4)+((A/3)+E)+(Y/10)/TV))
:End
: Disp "QB Rating:",VQB
: DelVar(P)
: DelVar(TDS)
: DelVar(G)
: DelVar(A)
: DelVar(TV)
: DelVar(E)
: DelVar(Y)
: DelVar(VQB)


where > is the sto-> function, VQB is quarterback value.

when it runs, everything works until the points at the end where it shows the results. AT this point, it displays an UNDEFINED error at the end of the line

: Disp "QB Rating:",VQB

It points at that line. Any help?

[Edited by foxsly on 22-Aug-03 18:20]
Digital
Guardian
avatar
Posted: 22 Aug 2003
09:53 GMT
Total Posts: 1051
Here is your error, I believe,

"VQB=(((TDS85)+(G/4)+((A/3)+E)+(Y/10)/TV))"

you have not defined TDS85. TDS is defined but not TDS85. I don't have any experience with BASIC on the 86 (I use an 89) but that could very well cause the error.

Edit: If you have any other programming questions, please use our "General Programming" forum. That is just to keep things a bit more organized, thank you.

[Edited by Digital on 22-Aug-03 18:55]
spiral
Wraith
Posted: 23 Aug 2003
03:44 GMT
Total Posts: 958
I'm not compeltely sure what you're trying to do...but i have experience programming with an 83+

If you're tryign to do TDSx85, make sure to put multiplication (i ahve no idea how it relates to football, but whatever).

Actually...just figuerd out the main problem, VQB is not defined, do this...

"(((TDS85)+(G/4)+((A/3)+E)+(Y/10)/TV))>VQB"
If you do VQB = something, no values are exchanged, so VQB has no values in it, you're just stating an equation in the middle of the code that has no effect. So put the storage into VQB at the end

I believe your parantheses are all correct.





Portal | My Account | Register | Lost Password or Username | TOS | Disclaimer | Help | Site Search | File Archives Copyright © 2002-2019 CalcG.org