IO¶
IO is a Lua standard library.
This library is heavily different from the Lua standard and is not available natively.
This library is implemented by CapyOS and is available globally.
Example¶
Lua | |
---|---|
Functions¶
write¶
io.write( text )
Write text to the terminal without newline.
Parameters¶
text
: any - Text to write.
Returns¶
lines
: number - How many lines it wrote.
read¶
io.read( replace?, history?, complete?, default? )
Prompt user to input a text.
Parameters¶
replace
: string - Character to hide what is typed in.history
: table - String array that contains the history, browseable by pressing up and down keys.complete
: function - Function to resolve user input and give hints to complete.default
: string - Value to start with.
Returns¶
input
: string - Text inputted by user.
stderr.write¶
io.stderr.write( text )
Write text to the terminal without newline. In red color.
Parameters¶
text
: any - Text to write.
Returns¶
lines
: number - How many lines it wrote.
stderr.print¶
io.stderr.print( ... )
Print text to the terminal with newline. In red color.
Parameters¶
...text
: any - Text to write.
Returns¶
lines
: number - How many lines it wrote.
Last update:
March 11, 2023
Created: March 11, 2023
Created: March 11, 2023