Difference between revisions of "Print"
From ComputerCraft Wiki
MKlegoman357 (Talk | contribs) m (Expanded) |
|||
(6 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
{{lowercase}} | {{lowercase}} | ||
{{Function | {{Function | ||
− | |name= | + | |name=print |
+ | |args={{type|string}} text | ||
+ | |api= | ||
+ | |returns={{type|number}} count of how many lines where printed | ||
+ | |addon=ComputerCraft | ||
+ | |desc=Lets you print anything to the terminal, automatically applies word-wrapping and scrolls down the display if needed. Prints all given arguments by using [[tostring]]() on them first. If no arguments are given, sets the cursor down a line and scrolls down if needed. For prompted scrolling, see [[textutils.pagedPrint]](); to avoid word-wrapping, see [[term.write]](). | ||
+ | |examples= | ||
+ | {{Example | ||
+ | |desc=Prints "Hello World!" on the computer's screen. | ||
+ | |code='''print("Hello World!")''' | ||
+ | |output=Hello World! | ||
+ | }} | ||
+ | }} | ||
+ | |||
+ | [[Category:Lua_Core_Functions]] |
Latest revision as of 17:38, 10 April 2014
Function print | |
Lets you print anything to the terminal, automatically applies word-wrapping and scrolls down the display if needed. Prints all given arguments by using tostring() on them first. If no arguments are given, sets the cursor down a line and scrolls down if needed. For prompted scrolling, see textutils.pagedPrint(); to avoid word-wrapping, see term.write(). | |
Syntax | print(string text) |
Returns | number count of how many lines where printed |
Part of | ComputerCraft |
API | none |
Examples
Example | |
Prints "Hello World!" on the computer's screen. | |
Code |
print("Hello World!") |
Output | Hello World! |