Page 1 of 1
need serious beginner help
Posted: Tue Mar 21, 2006 4:31 am
by Jimbo
Just got this wacky program because I always thought it was fun to make things on my graphing calculator. I was just trying to make this program about the standard formula for a line and I can't get the thing to work! It's been driving me nutty and any help would be greatly appreciated!
If OpenConsole()
PrintN(""):PrintN("Input A: ")
a.s=Input()
StrF(a)
PrintN(""):PrintN("Input B: ")
b.s=Input()
StrF(b)
PrintN(""):PrintN("Input C: ")
c.s=Input()
StrF(c)
xintercept.f=(c/a)
yintercept.f=(c/b)
ClearConsole()
PrintN("The X-intercept is "+Str(xintercept)+"and the Y-intercept is "+Str(yintercept)+".")
EndIf
End
Sincerely,
Jim

Posted: Tue Mar 21, 2006 5:12 am
by Dreglor
there is a few problems with your code,
StrF() returns the string version of a value. you want ValF(), that takes a string and extracts the floating point value from it
you need to assign the ValF() output to a varible it doesn't
Code: Select all
If OpenConsole()
PrintN(""):PrintN("Input A: ")
a.s=Input()
af.f = ValF(a)
PrintN(""):PrintN("Input B: ")
b.s=Input()
bf.f = ValF(b)
PrintN(""):PrintN("Input C: ")
c.s=Input()
cf.f = ValF(c)
xintercept.f=(cf/af)
yintercept.f=(cf/bf)
ClearConsole()
PrintN("The X-intercept is "+Str(xintercept)+"and the Y-intercept is "+Str(yintercept)+".")
EndIf
End
thank you
Posted: Tue Mar 21, 2006 5:26 am
by Jimbo
Hey, thanks a lot. Very commendable of you to spend your time. I hope you have a nice fortune soon!
oh yeah
Posted: Tue Mar 21, 2006 5:28 am
by Jimbo
It's hard to find thorough turorials for PureBasic. How did you guys figure this stuff out in the first place? It all seems very strange!
Posted: Tue Mar 21, 2006 5:43 am
by dracflamloc
The help file and experimentation! Not to mention many of us have lots of programming experience in other languages.
Re: oh yeah
Posted: Tue Mar 21, 2006 10:43 am
by Michael Vondung
Jimbo wrote:It's hard to find thorough turorials for PureBasic. How did you guys figure this stuff out in the first place? It all seems very strange!
Try here:
http://www.xs4all.nl/~bluez/datatalk/purebasic.htm
Posted: Sat Mar 25, 2006 9:21 pm
by milliHelp
Also, there is such helpful thing as MilliHelp - reference cards/diagrams for PB functions, that help to see the needed function at a couple of glances.
Lives here:
www.freewebs.com/millihelp
Posted: Sun Mar 26, 2006 9:13 am
by blueznl
but a. it's not for pb4 appearently, and b. it's a commercial product
<sarcasm on> next thing will be paul telling the world that with purevision you don't need much help at all... <sarcasm off>