need serious beginner help

Just starting out? Need help? Post your questions and find answers here.
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! :wink:

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
Jim:)
STU-ASI
User
User
Posts: 24
Joined: Thu Dec 08, 2005 10:56 am

Post by STU-ASI »

ok two things...

You are getting as string as input then trying to perform maths functions on it.
Not going to work...

Then you are trying to convert the input string to another string.

here is your ammended program.

just use the Val() around the input

Code: Select all

If OpenConsole() 
PrintN(""):PrintN("Input A: ") 
a.f=Val(Input())
 
PrintN(""):PrintN("Input B: ") 
b.f=Val(Input())

PrintN(""):PrintN("Input C: ") 
c.f=Val(Input())
 
xintercept.f=(c/a) 
yintercept.f=(c/b) 
ClearConsole() 
PrintN("The X-intercept is "+Str(xintercept)+"and the Y-intercept is "+Str(yintercept)+".")
x.s=Input() 
EndIf 
End
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

Just a polite reminder Jimbo, please only post in one forum section, we all read them all so we will see your post. Cross-posting makes things very messy. Ta. 8)
--Kale

Image
Post Reply