Difference between revisions of "Os.getComputerLabel"
From ComputerCraft Wiki
(Add return type, example output, and more notes) |
MKlegoman357 (Talk | contribs) m (Fixed/Expanded) |
||
Line 2: | Line 2: | ||
{{Function | {{Function | ||
|name=os.getComputerLabel | |name=os.getComputerLabel | ||
− | |returns= | + | |returns={{type|string}} the label of the Computer or {{type|nil}} if there is no label set |
|api=OS | |api=OS | ||
|addon=ComputerCraft | |addon=ComputerCraft | ||
Line 9: | Line 9: | ||
{{Example | {{Example | ||
|desc=prints the Computer Label | |desc=prints the Computer Label | ||
− | |code=print(os.getComputerLabel()) | + | |code=[[print]]('''os.getComputerLabel()''') |
− | |output= | + | |output=The computer's label or nothing if there is no label set |
}} | }} | ||
}} | }} | ||
[[Category:Lua_Core_Functions]] | [[Category:Lua_Core_Functions]] |
Latest revision as of 22:33, 3 June 2014
Function os.getComputerLabel | |
Reads the label from the executing computer. This is the label that shows up in the item tooltip if the computer is broken. The label can be set with os.setComputerLabel. This function is also available as os.computerLabel. | |
Syntax | os.getComputerLabel() |
Returns | string the label of the Computer or nil if there is no label set |
Part of | ComputerCraft |
API | OS |
Examples
Example | |
prints the Computer Label | |
Code |
print(os.getComputerLabel()) |
Output | The computer's label or nothing if there is no label set |