Qbasicnews.com

Full Version: Input with variables
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, before than all i'm argentinian so my english might be a bit weak, but i can read it very well.

I need to make an input with a variable... just that...
if you don't know what i'm saying, here's an example:

Code:
INPUT "What's your name "; name$

but instead to show the text "what's your name" i need to show a variable... i tried many things like these:

Code:
question$ = "How are you"
input question$;answer$

but no one worked Sad

Ok, thanks.-

Sorry if someone else asked this before, but i've searched in the forum and i haven't seen anything.
AS I was going to say before whitetiger typed his response 2 seconds before me,

use PRINT..

PRINT question$;
INPUT answer$
Try something like
Code:
PRINT question$;
INPUT answer$
The semicolon at the end of the print statement makes it so the line cursor doesn't go down a line.


Just run this and look at the results
Code:
PRINT "moo"
INPUT moo$

PRINT "moo";
INPUT moo$

PRINT "moo"
INPUT ; moo$

PRINT "moo";
INPUT ; moo$



Sorry If I wasn't very helpful. I'm getting sleepy
Completely helpful, I think. I was going to say the same thing, but I needed to make sure of something so I edited my post first..
Thank you so much, people Big Grin
thank you also because i was wondering the same thing recently. Smile