Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there a disk in a: drive?

Status
Not open for further replies.

phoenix

Programmer
May 7, 1999
1
US
How can I test for a floppy disk in drive a: and then test to find if it has enough disk space to download files from a network drive?
 
If you have QB45, try....<br>
<br>
' $DYNAMIC<br>
DEFINT A-Z<br>
TYPE RegTypeX<br>
AX AS INTEGER<br>
bx AS INTEGER<br>
CX AS INTEGER<br>
dx AS INTEGER<br>
bp AS INTEGER<br>
si AS INTEGER<br>
di AS INTEGER<br>
FLAGS AS INTEGER<br>
DS AS INTEGER<br>
ES AS INTEGER<br>
END TYPE<br>
<br>
DECLARE FUNCTION DiskFree& (Drive$)<br>
PRINT "There are"; DiskFree& ("A"); " bytes free on A:"<br>
<br>
FUNCTION DiskFree& (Drive$)<br>
DIM InRegs AS RegTypeX, OutRegs AS RegTypeX<br>
<br>
InRegs.AX = &H3600<br>
InRegs.dx = ASC(UCASE$(Drive$)) - ASC("A") + 1<br>
CALL interrupt(&H21, InRegs, OutRegs)<br>
IF OutRegs.AX = -1 THEN<br>
PRINT "Invalid drive or disk not in drive."<br>
EXIT FUNCTION<br>
END IF<br>
Temp& = OutRegs.AX<br>
temp2& = OutRegs.dx<br>
<br>
DiskFree& = OutRegs.AX * OutRegs.bx * OutRegs.CX<br>
<br>
END FUNCTION<br>
<br>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top