Qbasicnews.com

QBasic => QB Discussion & Programming Help => Topic started by: Fuseflow on October 07, 2004, 11:30:01 AM



Title: command$ doesnt accept Numeric value please help
Post by: Fuseflow on October 07, 2004, 11:30:01 AM
Hi
I Tried it works but only accepts as A string value i need value passed to be Integer when i use Cint function it gives me error

there is my code

abc.bas
if command$ > "" then
a% = command$
c% = a% + 1000
print c%
end if

but the same code works if i use a$


when i compile it trows me a error type mismatch
please help.
thanks in advance


Title: command$ doesnt accept Numeric value please help
Post by: VonGodric on October 07, 2004, 11:46:48 AM
if command$ > "" then
a% = val(command$)  '<--- VAL does the trick!
c% = a% + 1000
print c%
end if