QB64.org Forum

Active Forums => QB64 Discussion => Topic started by: eddy498 on March 16, 2019, 01:06:04 am

Title: new to qb64
Post by: eddy498 on March 16, 2019, 01:06:04 am
I have a question. when you code an input and it pops that ? is there a way for you put code for input but not have to have that ? show up
Title: Re: new to qb64
Post by: Pete on March 16, 2019, 01:51:21 am
Yes...

INPUT "My message here ", myvariable

instead of INPUT "My message here "; myvariable

So just use a "," instead of a ";" in front of your variable. (Comma = no question mark. Semicolon = question mark.)

... but for string input, you can do it either way, and no question mark will appear...

LINE INPUT "No question mark "; myvariable$
LINE INPUT "No question mark ", myvariable$

Pete
Title: Re: new to qb64
Post by: eddy498 on March 16, 2019, 03:14:33 pm
what i usually do is
print "my message here"
input myvariable$


that prints the question mark. is there a way of making it this way without the questionmark? i feel its a bit more organized since im placing alot of my coding with numbers in front to be able to use goto to move from one to another. its mainly to build like text based adventure game
Title: Re: new to qb64
Post by: bplus on March 16, 2019, 03:18:24 pm
Welcome to forum!
Code: QB64: [Select]
  1. PRINT "my message here"
  2. INPUT "", myvariable$
  3.  
Title: Re: new to qb64
Post by: Pete on March 16, 2019, 03:57:43 pm
Or...

PRINT "my message here"
LINE INPUT myvariable$

As I mentioned in my first post, LINE INPUT doesn't use a question sign. If you strictly want a numeric variable, then use what BPlus posted but with...

PRINT "my message here"
INPUT myvariable

If you still want to use PRINT and INPUT, but want the input on the same line, use...

PRINT "my message here ";
INPUT myvariable

or

PRINT "my message here ";
INPUT myvariable$

or

PRINT "my message here ";
LINE INPUT myvariable$

Pete
Title: Re: new to qb64
Post by: eddy498 on March 16, 2019, 07:58:53 pm
thanks that makes it alot better