Difference between revisions of "Disk.getID"
From ComputerCraft Wiki
(Int linking fix; awkward phrasing re-phrased.) |
(Fix name, clarify return value, and add description) |
||
| Line 1: | Line 1: | ||
{{lowercase}} | {{lowercase}} | ||
{{Function | {{Function | ||
| − | |name=disk. | + | |name=disk.getID |
|args=[[string (type)|string]] side | |args=[[string (type)|string]] side | ||
|api=disk | |api=disk | ||
| − | |returns=[[int (type)|int]] disk ID | + | |returns=[[int (type)|int]] 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. | ||
|examples= | |examples= | ||
{{Example | {{Example | ||
|desc=Prints the ID of the disk. | |desc=Prints the ID of the disk. | ||
| − | |code=print(disk. | + | |code=print(disk.getID("bottom")) |
|output=The ID of the disk (side varies). | |output=The ID of the disk (side varies). | ||
}} | }} | ||
}} | }} | ||
| − | |||
[[Category:API_Functions]] | [[Category:API_Functions]] | ||
Revision as of 18:46, 22 April 2013
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 | int the disk ID, or nil if the drive does not contain a Floppy Disk |
| Part of | ComputerCraft |
| API | disk |
Examples
| Prints the ID of the disk. | |
| Code |
print(disk.getID("bottom"))
|
| Output | The ID of the disk (side varies). |