Input()

Syntax

String$ = Input()
Description
Allows the program to catch an entire line of characters. This command locks the program execution and waits until the user presses the return key. The line cannot be longer than the console width (no more keys are accepted when the line gets too long).

Parameters:
This command has no parameters.


Return value:
A string containing the line of text that the user entered, without the return character.


Example:
If OpenConsole()
    Print("Enter your name and press return: ")
    name$=Input()

    ; The return key is not echoed to the console, so we print a blank
    ; string with a newline to move onto the next line after the user
    ; enters a line with Input()
    PrintN("")
    
    PrintN("Hello, "+name$+", nice to meet you.")
    PrintN("Press return to exit")
    Input()
    CloseConsole()
EndIf
End


Notes:
After the user presses return to input the line, the return character is not echoed (printed back) to the console. This means that if you want to move onto the next line after the user inputs a line, you must print a blank sring and newline as shown in the above example.

Supported OS

Windows, Linux, MacOS X

<- Inkey() - Console Index - OpenConsole() ->