Difference between revisions of "Disk.hasData"
From ComputerCraft Wiki
Scarfacial (Talk | contribs) (Created page with "{{lowercase}} {{Function |name=disk.hasData |args=string side |api=disk |returns=bool whether the disk has data |addon=ComputerCraft |examples= {{Example |...") |
Magiczocker (Talk | contribs) m |
||
| (10 intermediate revisions by 4 users not shown) | |||
| Line 2: | Line 2: | ||
{{Function | {{Function | ||
|name=disk.hasData | |name=disk.hasData | ||
| − | |args= | + | |args={{Type|string}} side |
|api=disk | |api=disk | ||
| − | |returns=[[ | + | |returns={{Type|boolean}} whether the item is a floppy |
| + | |desc=Checks whether the current disk is a [[Floppy Disk|floppy disk]], as opposed to a [https://minecraft.gamepedia.com/Music_Disc music disc] or other item. | ||
|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]] | ||
Latest revision as of 07:02, 4 August 2020
| 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
| Checks for what is in the bottom drive | |
| Code |
print(disk.hasData("bottom"))
|
| Output | true if the item is a floppy, otherwise false |