Difference between revisions of "Disk.getLabel"

From ComputerCraft Wiki
Jump to: navigation, search
(Note to self: Stop editing the wiki when you start getting tired.)
m (Use type template)
 
(6 intermediate revisions by 6 users not shown)
Line 2: Line 2:
 
{{Function
 
{{Function
 
|name=disk.getLabel
 
|name=disk.getLabel
|args=[[string (type)|string]] side
+
|args={{Type|string}} side
 
|api=disk
 
|api=disk
|returns=[[string (type)|string]] disk label
+
|returns={{Type|string}} disk label, or [[nil]] if the item in the drive is neither a floppy disk nor a music record or if it is a floppy disk with no label
 
|addon=ComputerCraft
 
|addon=ComputerCraft
 +
|desc=Reads the label from the disk in the drive. This is the label that shows up in the item tooltip (for both [[Floppy Disk|floppy disks]] and music records). For floppy disks, the label can be set with [[disk.setLabel]].
 
|examples=
 
|examples=
 
{{Example
 
{{Example
Line 13: Line 14:
 
}}
 
}}
 
}}
 
}}
 +
 +
[[Category:API_Functions]]

Latest revision as of 19:12, 22 April 2013


Grid Redstone.png  Function disk.getLabel
Reads the label from the disk in the drive. This is the label that shows up in the item tooltip (for both floppy disks and music records). For floppy disks, the label can be set with disk.setLabel.
Syntax disk.getLabel(string side)
Returns string disk label, or nil if the item in the drive is neither a floppy disk nor a music record or if it is a floppy disk with no label
Part of ComputerCraft
API disk

Examples

Grid paper.png  Example
Checks for data saved on the disk in the bottom drive
Code
print(disk.getLabel("bottom"))
Output Floppy --Output changes according to the disk label