Jump to content




Condition for a door system


  • You cannot reply to this topic
2 replies to this topic

#1 Galactix

  • New Members
  • 2 posts

Posted 11 August 2017 - 09:17 PM

Hello,
I need to know how to make a condition like "if diskIsIn = true then..." which would be true if a floppy disk is inside the disk drive of the computer or false if there is none.

Thanks

#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 11 August 2017 - 11:41 PM

if disk.isPresent("sideDriveIsOn") then

http://www.computerc.../Disk_%28API%29


#3 The Crazy Phoenix

  • Members
  • 136 posts
  • LocationProbably within 2 metres of my laptop.

Posted 12 August 2017 - 03:48 PM

Bomb Bloke's suggestion will return true if the inserted disk is a floppy disk or a music disk.
If you want to tell them apart, use disk.hasData("sideDriveIsOn") (returns true if a floppy disk is inserted).





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users