Author Topic: new to qb64  (Read 2821 times)

0 Members and 1 Guest are viewing this topic.

Offline eddy498

  • Newbie
  • Posts: 25
    • View Profile
new to qb64
« 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

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: new to qb64
« Reply #1 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
« Last Edit: March 16, 2019, 01:58:09 am by Pete »
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline eddy498

  • Newbie
  • Posts: 25
    • View Profile
Re: new to qb64
« Reply #2 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

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: new to qb64
« Reply #3 on: March 16, 2019, 03:18:24 pm »
Welcome to forum!
Code: QB64: [Select]
  1. PRINT "my message here"
  2. INPUT "", myvariable$
  3.  

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: new to qb64
« Reply #4 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
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline eddy498

  • Newbie
  • Posts: 25
    • View Profile
Re: new to qb64
« Reply #5 on: March 16, 2019, 07:58:53 pm »
thanks that makes it alot better