mirror of
https://github.com/QB64Official/qb64.git
synced 2024-07-01 08:00:37 +00:00
Uses GetLogicalDrives() in Windows (file dialogs). Closes #183
This commit is contained in:
parent
5f9a58a620
commit
5cab1880b5
|
@ -961,6 +961,14 @@ void call_setbits(uint32 bsize,ptrszint *array,ptrszint i,int64 val) {
|
|||
setbits(bsize,(uint8*)(*array),i,val);
|
||||
}
|
||||
|
||||
int32 logical_drives() {
|
||||
#ifdef QB64_WINDOWS
|
||||
return GetLogicalDrives();
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
inline ptrszint array_check(uptrszint index,uptrszint limit){
|
||||
//nb. forces signed index into an unsigned variable for quicker comparison
|
||||
if (index<limit) return index;
|
||||
|
|
|
@ -14316,12 +14316,19 @@ FUNCTION idezpathlist$ (path$)
|
|||
IF LEN(pathlist$) THEN pathlist$ = ".." + sep + pathlist$ ELSE pathlist$ = ".."
|
||||
END IF
|
||||
'add drive paths
|
||||
|
||||
DECLARE LIBRARY
|
||||
FUNCTION logical_drives& ()
|
||||
END DECLARE
|
||||
|
||||
d = logical_drives&
|
||||
FOR i = 0 TO 25
|
||||
IF RIGHT$(pathlist$, 1) <> sep AND LEN(pathlist$) > 0 THEN pathlist$ = pathlist$ + sep
|
||||
IF _DIREXISTS(CHR$(65 + i) + ":\") THEN
|
||||
IF _READBIT(d, i) THEN
|
||||
pathlist$ = pathlist$ + CHR$(65 + i) + ":"
|
||||
END IF
|
||||
NEXT
|
||||
|
||||
idezpathlist$ = pathlist$
|
||||
EXIT FUNCTION
|
||||
END IF
|
||||
|
|
Loading…
Reference in a new issue