[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
FT_FLOPTST()
Test diskette drive status
------------------------------------------------------------------------------
Syntax
FT_FLOPTST( <nDrive> ) -> nStatus
Arguments
<nDrive> is the diskette drive number, 0 = A:, 1 = B:
Returns
-1 - Wrong Parameters
0 - Drive Loaded and ready to read or write
1 - Drive Door Open or Diskette inserted upside down
2 - Diskette is unformatted
3 - Write protected
4 - Undetermined
Description
FT_FLOPTST() is designed as a full replacement for ISDRIVE(). Where
ISDRIVE() returns just .T. or .F. depending if the diskette drive is
ready or not, FT_FLOPTST() returns a numeric code designating the
diskette drive's status.
FT_FLOPTST() is particularly useful in backup and restore programs
that need to test the floppy drive before writing/reading from a
floppy disk.
No testing has been performed on systems with more than 2 floppy
drives. If the third drive is "C" and the fourth "D" then there
should be no problems.
This function does not currently check subst'd drives. So if you
have SUBST E: A:\ then FT_FLOPTST( ASC("E")-ASC("A") ) == 4
Any suggestions to fix this limitation are appreciated.
Examples
iStatus := FT_FLOPTST( 0 )
DO CASE
CASE iStatus == 1
Qout( "The door to drive A is open." )
CASE iStatus == 2
Qout( "The diskette in drive A is not formatted." )
CASE iStatus == 3
Qout( "The diskette in drive A is write-protected." )
CASE iStatus == 4
Qout( "Something is wrong with drive A, but I don't know what." )
ENDCASE
Source: FLOPTST.PRG
Author: Gary Smith
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson