KN> I was wondering if there was a way to eliminate the errors that occur
KN> somebody pulls a disk out of a floppy and then tires to shut down the
This routine will let you know if the floppy has been removed. It uses
the dos interrupt that gives info on a disc drive, of which you can get
the free space in bytes left which is what I used it for. But noticed
it would also return an error if the floppy is taken out so its pretty
handy. Eric
drive$="a:"
bytesfree&=chkdsk.space&(drive$)
if bytesfree&=-1 then
print "Error Accessing Drive "+drive$
else
print bytesfree&;"bytes left on ";drive$
end if
function chkdsk.space&(drive$)
local d%,ax&,bx&,cx&,d$
d$=left$(ucase$(drive$),1)
d%=asc(d$)-64
if d%=0 then exit function
reg 4,d%
reg 1,&h3600
call interrupt &h21
if reg(1) &hffff then
ax&=reg(1):bx&=reg(2):cx&=reg(3)
if ax& < 0 then ax&=ax&+65536
if bx& < 0 then bx&=bx&+65536
if cx& < 0 then cx&=cx&+65536
chkdsk.space&=ax&*bx&*cx&
else
'error accessing the drive
chkdsk.space&=-1
end if
end function
--- QM v1.00
---------------
* Origin: Creekside Manor (805) 484-8016 CdCom Support BBS (1:206/2512.0)
|