home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 3 Comm
/
03-Comm.zip
/
EASL2PRF.ZIP
/
GETDISK.OLD
< prev
next >
Wrap
Text File
|
1990-02-20
|
2KB
|
75 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
include fileio.inc
fileid FileID
string AvailDrives[26]
string DrivesPot[26]
string Access is "write"
string FileNameTemp GetDriveParms InitMsg
integer Cnt
subroutine GetDrives (integer:NumDrives) is
set pointer to SPTR_WAIT
action InitDriveNames
copy "Loading, please wait\nā" to InitMsg
change InitializeST text to InitMsg
copy 0 to NumDrives
start local GETDRIVES "CMD.EXE"
for Cnt = 1 to 24 loop
copy DrivesPot[Cnt] "\\$$$XX.$$$" to FileNameTemp
call Open(FileID, FileNameTemp, Access)
if (errorlevel > 0) then
#drive must not exist
call Close(FileID)
else
#drive must exist
append "ā" to InitMsg
change InitializeST text to InitMsg
call Close(FileID)
copy (NumDrives + 1) to NumDrives
copy DrivesPot[Cnt] to AvailDrives[NumDrives]
copy "DYNCMD.CMD ERASE " FileNameTemp "\n" to GetDriveParms
send GetDriveParms to GETDRIVES
begin guarded
response to line "ALL DONE" from GETDRIVES
leave block
response to line from GETDRIVES
# do nothing
end
end if
end loop
set pointer to SPTR_ARROW
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]