How to Eject a Disk in Only One Drive in Macintosh QuickBASIC (45175)






This article was previously published under Q45175

SUMMARY

QuickBASIC 1.00 for the Apple Macintosh has a built-in routine, EJECT (which is an MBPC resource), that allows a program to eject disks at a desired point in the program. The built-in EJECT routine ejects disks from both the internal and external drives, but cannot eject only one drive and leave a disk in the other drive.

Instead of using EJECT, you can use the following code segment to selectively eject either the internal or external floppy disk.
   ' This program segment will eject the internal drive.
   ' In order to eject the external, you must change
   ' the "1," in the DATA line to a "2,".
   DIM code%(100)    ' DIMmed to 100 for required buffer
   FOR count = 0 TO 6
   READ code%(count)
   NEXT count
   DATA &H41FA, &HC, &H317C, 1, &H16, &HA017, &H4E75
   removedsk = VARPTR(code%(0))
   CALL removedsk
				

Modification Type: Minor Last Reviewed: 1/8/2003
Keywords: KB45175