Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
DECLARE INTEGER GetLogicalDrives IN kernel32
DIMENSION aDrives(26) && Drive letters found will be stored in this array
GetDrives()
? "Available disk drives:"
FOR nCnt = 1 TO ALEN(aDrives)
? aDrives(nCnt)
ENDFOR
RETURN
*!*
FUNCTION GetDrives
*!* The GetLogicalDrives function retrieves a bitmask
*!* representing the currently available disk drives
*!*
*!* The return value is a bitmask
*!* representing the currently available disk drives.
*!* Bit position 0 (the least-significant bit) is drive A,
*!* bit position 1 is drive B, bit position 2 is drive C,
*!* and so on
LOCAL nDrivesMask, nIndex, nShift, nAIdx
nDrivesMask = GetLogicalDrives()
nIndex = 0
nAIdx = 0
DO WHILE .T.
nShift = BITLSHIFT(1, nIndex)
IF BITAND(nDrivesMask, nShift) = nShift
nAIdx = nAIdx + 1
aDrives(nAIdx) = CHR(nIndex + 65)
ENDIF
IF nShift > nDrivesMask
EXIT
ENDIF
nIndex = nIndex + 1
ENDDO
DIMENSION aDrives(nAIdx) &&Redimension array to the number of drives we found
RETURN