×
Menu
Index

ISDRIVE Subroutine

 
Usage:
n = ISDRIVE(s)
 
Description:
ISDRIVE returns 1 if the drive indicated by s is a valid disk drive. Otherwise, 0 is returned. Only the first character in s is examined so strings like "c", "C:", and "c:\temp" all produce the same result.
 
NOTE: If the specified drive is an existing drive but is not ready (for example, if a floppy drive has no disk in it), ISDRIVE returns 0.
 
Example:
sub main()
   for i = 1 to 26
      s = chr(asc("@") + i)
      if isdrive(s) then
         printl("Drive ", s, ":")
      end if
   next
end sub