Difference between revisions of "Term.clear"

From ComputerCraft Wiki
Jump to: navigation, search
m (Cleaned up return value, code example description, and added a new example of possible uses with term.clear (there are no args for term.clear and by putting 'none' it could be misleading to new members))
m
 
(One intermediate revision by one other user not shown)
Line 5: Line 5:
 
|api=term
 
|api=term
 
|addon=ComputerCraft
 
|addon=ComputerCraft
|desc=Clears the screen
+
|desc=Clears the screen by overwriting the whole display with blank spaces. The results are affected by the current [[term.setBackgroundColor|background colour]].
 
|examples=
 
|examples=
 
{{Example
 
{{Example
|desc=Clears any text on the console or monitor, also sets the cursor to position (1, 1) on the screen.
+
|desc=Clears all text on the console or monitor and sets the cursor to coordinate (1, 1) on the screen.
|code=term.clear()<br />term.setCursorPos(1,1)
+
|code=[[term.clear]]()<br />[[term.setCursorPos]](1,1)
 
}}
 
}}
 
{{Example
 
{{Example
 
|desc=Turns the screen a specified colour
 
|desc=Turns the screen a specified colour
|code=term.setBackgroundColor(colors.blue)<br>term.clear()
+
|code=[[term.setBackgroundColor]]([[Color_(API)|colors]].blue)<br>[[term.clear]]()
 
}}
 
}}
 
}}
 
}}
  
 
[[Category:API_Functions]]
 
[[Category:API_Functions]]

Latest revision as of 03:01, 25 June 2014


Grid Redstone.png  Function term.clear
Clears the screen by overwriting the whole display with blank spaces. The results are affected by the current background colour.
Syntax term.clear()
Returns nil
Part of ComputerCraft
API term

Examples

Grid paper.png  Example
Clears all text on the console or monitor and sets the cursor to coordinate (1, 1) on the screen.
Code
term.clear()
term.setCursorPos(1,1)



Grid paper.png  Example
Turns the screen a specified colour
Code
term.setBackgroundColor(colors.blue)
term.clear()