Difference between revisions of "Printer.endPage"
From ComputerCraft Wiki
(Created page with "{{lowercase}} {{Function |name=printer.endPage |args=none |returns=(boolean) If the page termination was successful. |api=none |addon=ComputerCraft |desc=Terminate...") |
MKlegoman357 (Talk | contribs) m (Expanded) |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{lowercase}} | {{lowercase}} | ||
{{Function | {{Function | ||
− | |name=printer.endPage | + | |name=''printer''.endPage |
− | + | |returns={{type|boolean}} was the page printed? | |
− | |returns= | + | |api=printer |
− | |api= | + | |
|addon=ComputerCraft | |addon=ComputerCraft | ||
− | |desc= | + | |desc=Ends and prints the page to the output tray. Returns true if page was ended, false if not.<br/><br/>This function will return false if there is no place to print the page or if there is no page started. |
|examples= | |examples= | ||
{{Example | {{Example | ||
|desc= Prints out the current page. | |desc= Prints out the current page. | ||
− | |code= | + | |code= local printer = [[peripheral.wrap]]("left") |
− | |output= | + | |
+ | [[printer.newPage]]() | ||
+ | [[printer.write]]("Hello") | ||
+ | |||
+ | if printer.endPage() then | ||
+ | print("Page was printed successfully!") | ||
+ | else | ||
+ | error("Could not print page.") | ||
+ | end | ||
+ | |output=Prints whether or not the printer was able to print the page. | ||
}} | }} | ||
}} | }} | ||
+ | |||
+ | [[Category:Lua_Core_Functions]] |
Latest revision as of 18:00, 9 April 2014
Function printer.endPage | |
Ends and prints the page to the output tray. Returns true if page was ended, false if not. This function will return false if there is no place to print the page or if there is no page started. | |
Syntax | printer.endPage() |
Returns | boolean was the page printed? |
Part of | ComputerCraft |
API | printer |
Examples
Example | |
Prints out the current page. | |
Code |
local printer = peripheral.wrap("left") printer.newPage() printer.write("Hello") if printer.endPage() then print("Page was printed successfully!") else error("Could not print page.") end |
Output | Prints whether or not the printer was able to print the page. |