[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 264: mysqli_fetch_assoc(): Couldn't fetch mysqli_result
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 326: mysqli_free_result(): Couldn't fetch mysqli_result
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 264: mysqli_fetch_assoc(): Couldn't fetch mysqli_result
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 326: mysqli_free_result(): Couldn't fetch mysqli_result
Pete's QBASIC Site Discuss QBasic, Freebasic, QB64 and more 2013-07-20T11:07:01-05:00 http://petesqbsite.com/phpBB3/app.php/feed/topic/3787 2013-07-20T11:07:01-05:00 2013-07-20T11:07:01-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=22751#p22751 <![CDATA[QB64 program to find drives on computer]]>

Code:

CONST REMOVABLE = 2CONST FIXED = 3CONST REMOTE = 4CONST CDROM = 5CONST RAMDISK = 6DECLARE LIBRARY  FUNCTION GetDriveTypeA& (nDrive AS STRING)  FUNCTION GetLogicalDriveStringsA (BYVAL nBuff AS LONG, lpbuff AS STRING)END DECLAREDIM DList AS STRING, DL AS STRINGDIM i AS LONG, typ AS LONGi = GetLogicalDriveStringsA(0, DList) 'zero returns the drive string byte sizeDList = SPACE$(i) 'set drive string length. Each drive is followed by CHR$(0)i = GetLogicalDriveStringsA(i, DList) 'the byte size returns a string that longPRINT DListFOR n = 65 TO 90  IF INSTR(DList, CHR$(n)) THEN    DL = CHR$(n) + ":\" + CHR$(0)    typ = GetDriveTypeA(DL)    SELECT CASE typ      CASE REMOVABLE: PRINT DL + "Removable"      CASE FIXED: PRINT DL + "Fixed"      CASE REMOTE: PRINT DL + "Remote"      CASE CDROM: PRINT DL + "CDROM"      CASE RAMDISK: PRINT DL + "RAM"    END SELECT  END IFNEXT
WIKI list of Windows API programs

Statistics: Posted by burger2227 — Sat Jul 20, 2013 11:07 am


]]>