Difference between revisions of "Print"
From ComputerCraft Wiki
Bomb Bloke (Talk | contribs) m |
MKlegoman357 (Talk | contribs) m (Expanded) |
||
Line 2: | Line 2: | ||
{{Function | {{Function | ||
|name=print | |name=print | ||
− | |args= | + | |args={{type|string}} text |
|api= | |api= | ||
+ | |returns={{type|number}} count of how many lines where printed | ||
|addon=ComputerCraft | |addon=ComputerCraft | ||
− | |desc=Lets you print | + | |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= | |examples= | ||
{{Example | {{Example | ||
− | |desc=Prints | + | |desc=Prints "Hello World!" on the computer's screen. |
− | |code=print("Hello World!") | + | |code='''print("Hello World!")''' |
|output=Hello World! | |output=Hello World! | ||
}} | }} |
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! |