Difference between revisions of "Disk.hasData"

From ComputerCraft Wiki
Jump to: navigation, search
(This does not check whether there is anything on the disk, rather what type of item is in the drive)
(Take better description from function table on API page)
Line 5: Line 5:
 
|api=disk
 
|api=disk
 
|returns=[[boolean_(type)|boolean]] whether the item is a floppy
 
|returns=[[boolean_(type)|boolean]] whether the item is a floppy
|desc=Checks whether the item in the drive is a [[Floppy Disk]].
+
|desc=Checks whether the current disk is a [[Floppy Disk|floppy disk]], as opposed to a [http://www.minecraftwiki.net/wiki/Music_Discs music disc] or other item.
 
|addon=ComputerCraft
 
|addon=ComputerCraft
 
|examples=
 
|examples=

Revision as of 19:07, 22 April 2013


Grid Redstone.png  Function disk.hasData
Checks whether the current disk is a floppy disk, as opposed to a music disc or other item.
Syntax disk.hasData(string side)
Returns boolean whether the item is a floppy
Part of ComputerCraft
API disk

Examples

Grid paper.png  Example
Checks for what is in the bottom drive
Code
print(disk.hasData("bottom"))
Output true if the item is a floppy, otherwise false