Difference between revisions of "Os.setComputerLabel"

From ComputerCraft Wiki
Jump to: navigation, search
m (Updated references from "os" to "OS")
m (Fixed/Expanded)
 
(One intermediate revision by one other user not shown)
Line 2: Line 2:
 
{{Function
 
{{Function
 
|name=os.setComputerLabel
 
|name=os.setComputerLabel
|args=[[string (type)|string]] label
+
|args={{type|string}}/{{type|nil}} label
|returns=Unknown
+
|returns={{type|nil}}
 
|api=OS
 
|api=OS
 
|addon=ComputerCraft
 
|addon=ComputerCraft
|desc=Set the label of the computer this command is executed on to <var>label</var>.
+
|desc=Sets or resets the label of the computer to <var>label</var>. If called with no parameters resets the label. The label can be read with [[os.getComputerLabel]] and viewed in the item tooltip if the computer is broken.
 
|examples=
 
|examples=
 
{{Example
 
{{Example
|desc=set the Computer label to "My Computer"
+
|desc=Sets the Computer label to "My Computer".
|code=os.setComputerLabel("My Computer")
+
|code='''os.setComputerLabel("My Computer")'''
 
}}
 
}}
 
}}
 
}}
  
 
[[Category:Lua_Core_Functions]]
 
[[Category:Lua_Core_Functions]]

Latest revision as of 22:31, 3 June 2014


Grid Redstone.png  Function os.setComputerLabel
Sets or resets the label of the computer to label. If called with no parameters resets the label. The label can be read with os.getComputerLabel and viewed in the item tooltip if the computer is broken.
Syntax os.setComputerLabel(string/nil label)
Returns nil
Part of ComputerCraft
API OS

Examples

Grid paper.png  Example
Sets the Computer label to "My Computer".
Code
os.setComputerLabel("My Computer")