>I need to find out the specifc drive letter being used for the CDROM drive. If there anything in VFP50 that will return the value. I know that os() returns the operating system. Is there anything like that in VFP that will return the CDROM drive = D:\ or F:\. Something to that nature.
>Thanks is advance
Hi Jason,
For VFP 5.0 the foxtools library has a function Drivetype() which will return the type of drive. This function, BTW, became part of the language in 6.0. The following code snippet will locate a CD ROM drive:
DECLARE INTEGER GetLogicalDrives IN Win32API
IF NOT "6." $ VERSION()
SET LIBRARY TO FOXTOOLS ADDITIVE
ENDIF
llfound = .F.
lni = 0
lnlast = 25
STORE "" TO lcresult, lcdrive
lndrives = GetLogicalDrives()
DO WHILE NOT llfound AND lni < lnlast
IF BITTEST(lndrives, lni)
lcdrive = CHR(65 + lni)
llfound = (GetDriveType(lcdrive) = 5)
ENDIF
lni = lni + 1
ENDDO
IF llfound
lcresult = lcdrive
ENDIF
RETURN lcresult
hth,
George
Ubi caritas et amor, deus ibi est