Difference between revisions of "Disk.hasData"
From ComputerCraft Wiki
m (Corrected mapping from "Boolean" to "Boolean (type)") |
(This does not check whether there is anything on the disk, rather what type of item is in the drive) |
||
Line 4: | Line 4: | ||
|args=[[string (type)|string]] side | |args=[[string (type)|string]] side | ||
|api=disk | |api=disk | ||
− | |returns=[[boolean_(type)|boolean]] whether the | + | |returns=[[boolean_(type)|boolean]] whether the item is a floppy |
+ | |desc=Checks whether the item in the drive is a [[Floppy Disk]]. | ||
|addon=ComputerCraft | |addon=ComputerCraft | ||
|examples= | |examples= | ||
{{Example | {{Example | ||
− | |desc=Checks for | + | |desc=Checks for what is in the bottom drive |
|code=print(disk.hasData("bottom")) | |code=print(disk.hasData("bottom")) | ||
− | |output=true if the | + | |output=true if the item is a floppy, otherwise false |
}} | }} | ||
}} | }} | ||
[[Category:API_Functions]] | [[Category:API_Functions]] |
Revision as of 18:28, 21 April 2013
Function disk.hasData | |
Checks whether the item in the drive is a Floppy Disk. | |
Syntax | disk.hasData(string side) |
Returns | boolean whether the item is a floppy |
Part of | ComputerCraft |
API | disk |
Examples
Example | |
Checks for what is in the bottom drive | |
Code |
print(disk.hasData("bottom")) |
Output | true if the item is a floppy, otherwise false |