Hi everyone,
I am new to GLBasic and am having problems with basic input for the keyboard. The input command seems to behave different to other languages I have used.
If I write something simple like,
INPUT name$, 0, 0
after typing a name in and pressing the ENTER key this creates a blank space and doesn't move on within the program.
Should this behave like this? What am I doing wrong?
Thanks.
It is a bug with latest GLB (9.040).
Try the previous one, or get the beta.
Or don't use INPUT$ at all. It's a bit of a stupid function.
What other way can I get input from the keyboard and store it in a variable?
You could use DDgui, or most games read one character at a time and build up a string from that.
Cheers, I will use this method as Input isn't working. (My program would be alot simplier if this did work though)
I wanted to start with a simple console program but seem to be having trouble even displaying text on the console screen. The print command doesn't seem to do anything.
Quote from: Kirkkaf on 2011-Apr-18
The print command doesn't seem to do anything.
...you have SHOWSCREEN on your code right?
Yes, and still my console window appears blank.
EDITED: I didn't think console windows use double buffers either.
With console programs, you use STDIN and STDOUT
So how do you write to a console window?
That is what I ment, thanks for correcting me, how about an example because I can't seem to write IN the console window.
// Echo Win32 keyboard input to GLB Output in debug mode only
WHILE TRUE
DEBUG INKEY$()
SHOWSCREEN
WEND
Try :
STDOUT "This is a test"
KEYWAIT
in a console program