home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 3 Comm
/
03-Comm.zip
/
EASL2PRF.ZIP
/
GETDISK1.INC
< prev
next >
Wrap
Text File
|
1990-01-30
|
3KB
|
71 lines
# Gets the list of available drives and puts them in an array
# We are going to assume that A: and B: are available, so we'll just
# test the hard drives.
application GETDRIVES
string AvailDrives[26]
string DrivesPot[26]
integer Cnt
subroutine GetDrives (integer:NumDrives) is
string TestDrive
integer Cnt
action InitDriveNames
copy 0 to NumDrives
start local GETDRIVES "cmd.exe"
for Cnt = 1 to 24 loop
copy "VOL " DrivesPot[Cnt] to TestDrive
send TestDrive "\n" to GETDRIVES
begin guarded
response to char "SYS" from GETDRIVES
#error message return, so drive is not there
send input to errorlog
leave block
response to char "Volume in" from GETDRIVES
# no volume label, but disk exists
copy (NumDrives + 1) to NumDrives
copy DrivesPot[Cnt] to AvailDrives[NumDrives]
send input "\n" to errorlog
send Cnt DrivesPot[Cnt] "\n" to errorlog
leave block
response to char "The volume label in" from GETDRIVES
# volume has a label, so disk exists
copy (NumDrives + 1) to NumDrives
copy DrivesPot[Cnt] to AvailDrives[NumDrives]
send input "\n" to errorlog
send Cnt DrivesPot[Cnt] "\n" to errorlog
leave block
response to line from GETDRIVES
# volume has a label, so disk exists
send input "\n" to errorlog
end
end loop
action InitDriveNames is
copy "C:" to DrivesPot[1]
copy "D:" to DrivesPot[2]
copy "E:" to DrivesPot[3]
copy "F:" to DrivesPot[4]
copy "G:" to DrivesPot[5]
copy "H:" to DrivesPot[6]
copy "I:" to DrivesPot[7]
copy "J:" to DrivesPot[8]
copy "K:" to DrivesPot[9]
copy "L:" to DrivesPot[10]
copy "M:" to DrivesPot[11]
copy "N:" to DrivesPot[12]
copy "O:" to DrivesPot[13]
copy "P:" to DrivesPot[14]
copy "Q:" to DrivesPot[15]
copy "R:" to DrivesPot[16]
copy "S:" to DrivesPot[17]
copy "T:" to DrivesPot[18]
copy "U:" to DrivesPot[19]
copy "V:" to DrivesPot[20]
copy "W:" to DrivesPot[21]
copy "X:" to DrivesPot[22]
copy "Y:" to DrivesPot[23]
copy "Z:" to DrivesPot[24]