QB64.org Forum
Active Forums => QB64 Discussion => Topic started by: euklides on May 02, 2021, 10:39:14 am
-
Please see:
https://www.qb64.org/forum/index.php?topic=2689.msg119268#top (locked)
Well, the program given by bplus works fine, but you can select only ONE file.
Is there a way to select directly multiple files (located in a directory, of course) ?
-
There is a way to select multiple files but not directly, something you would have to code unless the API guy has something through Windows?
I am thinking of a UDT array with file names and some little symbol place next to each to indicate if user selected it or not, or you might try shading the items that are selected with each redraw in loop.
-
For output the selection of multiple files:
Using _CLIPBOARD$, you put all the file name selected.
_CLIPBOARD$ = <file name 1> + chr$(0) + <file name 2> + chr$(0) ... aso
then splitting...
------------------------------
But how select multiple files ?
in the program you have:
CONST OFN_ALLOWMULTISELECT = &H200& ' Allows the user to select more than one file, not recommended!
But impossible to select more than on file...
-
in the program you have:
CONST OFN_ALLOWMULTISELECT = &H200& ' Allows the user to select more than one file, not recommended!
OK that's not my program, but it would be good exercise to have multi-file selection and cross platform and select paths too!
-
Is there a way to select directly multiple files (located in a directory, of course) ?
Yep sure why not. You can select multiple files that can also be opened at the same time.
-
Of course, if you change
Flags& = OFN_FILEMUSTEXIST + OFN_NOCHANGEDIR + OFN_READONLY
with
Flags& = OFN_ALLOWMULTISELECT + OFN_FILEMUSTEXIST + OFN_NOCHANGEDIR + OFN_READONLY
before using GetOpenFileName$(...) command, you can select multiple files and see them in the OFile$ variable. (file names separated with space)
BUT... sometime you can get only the short name of the files (ex: demontration number 1.jpg--> demontr~1.jgp)