GLBasic User Manual

Main sections

STDIN$()

text$ = STDIN$()



STDIN$():
Reads a string from the standard input stream - usually the console input window.
The input is terminated by the newline character ("\n") which will be truncated from the input string. The buffer is limited to 4095 characters, GLBasic prevents buffer overflows.

The STDOUT/STDIN/STDERR commands are really only useful for making a console program. See the menu Project/Options.

STDOUT "Name:\n"
name$ = STDIN$()

STDOUT "You are: "+name$ + "\n"

WHILE TRUE
ink$ = INKEY$()
IF LEN(ink$) THEN STDOUT "Key: "+ink$+"\n"
WEND

See also...