mirror of
https://github.com/QB64Official/qb64.git
synced 2024-07-05 14:40:23 +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);
|
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){
|
inline ptrszint array_check(uptrszint index,uptrszint limit){
|
||||||
//nb. forces signed index into an unsigned variable for quicker comparison
|
//nb. forces signed index into an unsigned variable for quicker comparison
|
||||||
if (index<limit) return index;
|
if (index<limit) return index;
|
||||||
|
|
|
@ -14316,12 +14316,19 @@ FUNCTION idezpathlist$ (path$)
|
||||||
IF LEN(pathlist$) THEN pathlist$ = ".." + sep + pathlist$ ELSE pathlist$ = ".."
|
IF LEN(pathlist$) THEN pathlist$ = ".." + sep + pathlist$ ELSE pathlist$ = ".."
|
||||||
END IF
|
END IF
|
||||||
'add drive paths
|
'add drive paths
|
||||||
|
|
||||||
|
DECLARE LIBRARY
|
||||||
|
FUNCTION logical_drives& ()
|
||||||
|
END DECLARE
|
||||||
|
|
||||||
|
d = logical_drives&
|
||||||
FOR i = 0 TO 25
|
FOR i = 0 TO 25
|
||||||
IF RIGHT$(pathlist$, 1) <> sep AND LEN(pathlist$) > 0 THEN pathlist$ = pathlist$ + sep
|
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) + ":"
|
pathlist$ = pathlist$ + CHR$(65 + i) + ":"
|
||||||
END IF
|
END IF
|
||||||
NEXT
|
NEXT
|
||||||
|
|
||||||
idezpathlist$ = pathlist$
|
idezpathlist$ = pathlist$
|
||||||
EXIT FUNCTION
|
EXIT FUNCTION
|
||||||
END IF
|
END IF
|
||||||
|
|
Loading…
Reference in a new issue