need serious beginner help

Everything else that doesn't fall into one of the other PB categories.
Jimbo
New User
New User
Posts: 4
Joined: Tue Mar 21, 2006 4:13 am
Location: Master

need serious beginner help

Post 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 :cry:
Jim:)
Dreglor
Enthusiast
Enthusiast
Posts: 759
Joined: Sat Aug 02, 2003 11:22 pm
Location: OR, USA

Post 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
~Dreglor
Jimbo
New User
New User
Posts: 4
Joined: Tue Mar 21, 2006 4:13 am
Location: Master

thank you

Post by Jimbo »

Hey, thanks a lot. Very commendable of you to spend your time. I hope you have a nice fortune soon!
Jim:)
Jimbo
New User
New User
Posts: 4
Joined: Tue Mar 21, 2006 4:13 am
Location: Master

oh yeah

Post 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!
Jim:)
dracflamloc
Addict
Addict
Posts: 1648
Joined: Mon Sep 20, 2004 3:52 pm
Contact:

Post by dracflamloc »

The help file and experimentation! Not to mention many of us have lots of programming experience in other languages.
Michael Vondung
New User
New User
Posts: 2
Joined: Sun Mar 19, 2006 8:20 am
Location: Germany
Contact:

Re: oh yeah

Post 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
milliHelp
User
User
Posts: 18
Joined: Sun Jun 29, 2003 10:14 pm

Post 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
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post 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>
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Post Reply