Syntax
rconsoleinput(): stringAliases
consoleinputReturns
| Name | Type | Description |
|---|---|---|
input | string | Line of text read from stdin, without the terminating newline. |
Description
Waits for one line of input from the current Windows console and returns it without the ending newline. If no console window exists, the call returns no values.
Call it without parameters. The function reads the needed context from the current runtime state.
It returns input (string). Use the returns table to separate successful values from nil results and recoverable errors.
Example
Read one submitted line from the current Windows console.
rconsolecreate()
rconsoleprint("Name: ")
local name = rconsoleinput()
rconsoleprint("Hello, ", name, "
")