Difference between revisions of "Disk.getID"

From ComputerCraft Wiki
Jump to: navigation, search
m (Use type template)
(Changing int to number)
 
Line 4: Line 4:
 
|args={{Type|string}} side
 
|args={{Type|string}} side
 
|api=disk
 
|api=disk
|returns={{Type|int}} the disk ID, or [[nil]] if the drive does not contain a [[Floppy Disk]]
+
|returns={{Type|number}} the disk ID, or [[nil]] if the drive does not contain a [[Floppy Disk]]
 
|addon=ComputerCraft
 
|addon=ComputerCraft
 
|desc=Returns a number which uniquely identifies the disk in the drive and which is the name of the directory in the world’s <code>computer/disk</code> directory containing the disk’s data.
 
|desc=Returns a number which uniquely identifies the disk in the drive and which is the name of the directory in the world’s <code>computer/disk</code> directory containing the disk’s data.

Latest revision as of 14:27, 18 July 2013


Grid Redstone.png  Function disk.getID
Returns a number which uniquely identifies the disk in the drive and which is the name of the directory in the world’s computer/disk directory containing the disk’s data.
Syntax disk.getID(string side)
Returns number the disk ID, or nil if the drive does not contain a Floppy Disk
Part of ComputerCraft
API disk

Examples

Grid paper.png  Example
Prints the ID of the disk.
Code
print(disk.getID("bottom"))
Output The ID of the disk (side varies).