Posts: 22
Threads: 8
Joined: Oct 2004
heres my code so far, my input isnt allowing letters only numbers
Code:
cls
input "Input Friends Name";nameA
input "Input Friends Weight";weight1
'planets gravity
mercury = .27
venus = .85
earth = 1
moon = .16
mars =.18
jupiter = 2.64
saturn = 1.17
uranus = .92
neptune = 1.12
when i input a friends name as a test it wont take it however it will allow the numbers.
ife is Short Lets pick on it.
Posts: 719
Threads: 72
Joined: Mar 2003
[syntax="qbasic"]cls
input "Input Friends Name";nameA$[/syntax]
there must be the '$' after the varible to say it is a string
Oz~
Posts: 1,080
Threads: 87
Joined: Feb 2002
Or, at the start:
[syntax="qbasic"]dim nameA as string[/syntax]
/post]
Posts: 2,765
Threads: 138
Joined: Nov 2002
[syntax="QBASIC"]INPUT "Your weight? ", weight
PRINT "Your weight in space is"; weight * 0[/syntax]
Shhhhhhhhhhhhhhhhhh
Sorry had to :roll:
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Posts: 4,307
Threads: 63
Joined: May 2003
Quote:[syntax="QBASIC"]INPUT "Your weight? ", weight
PRINT "Your weight in space is"; weight * 0[/syntax]
Shhhhhhhhhhhhhhhhhh
Sorry had to :roll:
Not really. It depends upon your proximity to a source of gravity =P.
rhoward: Its a good practice to declare the variables before you start off using them. If you dont want to declare them then you can add a suffix to indicate their type. For eg. Strings - $, Integer - %, Single precision - !, Double Precision - &
Quote:cls
input "Input Friends Name", nameA$
input "Input Friends Weight", weight1!
'planets gravity
mercury! = .27
venus! = .85
earth! = 1
moon! = .16
mars! =.18
jupiter! = 2.64
saturn! = 1.17
uranus! = .92
neptune! = 1.12
Posts: 3,522
Threads: 189
Joined: Dec 2003
Default type in QB is single... thus ! is not needed unless you use defint, deflng, defstr
Posts: 116
Threads: 5
Joined: Jul 2004
Code:
cls
input "Input Friends Name";nameA
input "Input Friends Weight";weight1
'planets gravity
mercury = .27
venus = .85
earth = 1
moon = .16
mars =.18
jupiter = 2.64
saturn = 1.17
uranus = .92
neptune = 1.12
What about Pluto?
Posts: 979
Threads: 27
Joined: Aug 2001
Nobody cares about pluto. "Weightlessness" has nothing to do with being far away from earth. "g" is still 8.something in orbit, it's the centripital force of the craft in orbit countering gravity that makes you weightless.
So long as there is other matter in the universe, you can't really be weightless.
Posts: 116
Threads: 5
Joined: Jul 2004
Quote:Nobody cares about pluto.
Oh, should I ask this Nobody guy then?
Where can I get in touch with Nobody?
Jofers, please reply as soon as possible!
Thanks,
Nemesis
Posts: 4,307
Threads: 63
Joined: May 2003
I thought you were Mr.Nobody! :rotfl: