GetFile

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
serge_girard
Posts: 3166
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

GetFile

Post by serge_girard »

Hello, It's me finally back again...

I need to upload hunderds of small files and I used GETFILE to select them.

If <lMultiSelect> option is used, a character array containing selected filenames is returned (maximum number of selected files returned is 63).
Is there anyway to change this max number or anyone has a work-around?

Thanks,

Serge
There's nothing you can do that can't be done...
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: GetFile

Post by esgici »

serge_girard wrote:Hello, It's me finally back again...
You are welcome back :)
If <lMultiSelect> option is used, a character array containing selected filenames is returned (maximum number of selected files returned is 63).
Is there anyway to change this max number or anyone has a work-around?
+1

Regards
Last edited by esgici on Mon Sep 22, 2014 2:52 pm, edited 1 time in total.
Viva INTERNATIONAL HMG :D
User avatar
Clip2Mania
Posts: 99
Joined: Fri Jun 13, 2014 7:16 am
Location: Belgium

Re: GetFile

Post by Clip2Mania »

Hi Serge,
...anyone has a work-around?
you may use HB_DirScan (with filter) to load files in an array.
Then load the array in a grid.
Implement a 'select' function in the grid (e.g. by double-clicking on each file you want selected).
Then perform the action(s) you want to do on the files.

Regards,
Erik
User avatar
serge_girard
Posts: 3166
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: GetFile

Post by serge_girard »

Thank you, Erik for this work-around. I started allready with the same idea as solution.

Esgici, thank for the nice words, as usually !

Serge
There's nothing you can do that can't be done...
User avatar
Clip2Mania
Posts: 99
Joined: Fri Jun 13, 2014 7:16 am
Location: Belgium

Re: GetFile

Post by Clip2Mania »

Hi Serge,

please find some code example attached. (check line 121 on what to scan for - ".prg" in this example).
By double-clicking on a file, you can select/unselect it.

The only thing you have to do is add the action you want to perform on each file. ;)

Regards,
Erik
Attachments
Dirselect.zip
(1.67 KiB) Downloaded 394 times
User avatar
serge_girard
Posts: 3166
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: GetFile

Post by serge_girard »

Thanks Erik !

I will have a look at it.

Serge
There's nothing you can do that can't be done...
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: GetFile

Post by Javier Tovar »

serge_girard wrote:Hola, Soy yo, finalmente, volver otra vez ...
Que bueno que estas de nuevo en la jugada...

Saludos
User avatar
serge_girard
Posts: 3166
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: GetFile

Post by serge_girard »

Sí, gracias !

Serge
There's nothing you can do that can't be done...
User avatar
Clip2Mania
Posts: 99
Joined: Fri Jun 13, 2014 7:16 am
Location: Belgium

Re: GetFile

Post by Clip2Mania »

If <lMultiSelect> option is used, a character array containing selected filenames is returned (maximum number of selected files returned is 63).
Is there anyway to change this max number or anyone has a work-around?
If you look in c_dialogs.c,
declaration on line 169:

Code: Select all

TCHAR cFullName[64][1024];
You could change the '64' to e.g. '128'. Then change also line 253:

Code: Select all

while(  (lstrlen(cFileName)!=0) && ( iNumSelected <= 63 ) );
to '128-1=127' in this case.
Then rebuild the code, of course...
Beware: modifying the source code will void your warranty :D :D :D
User avatar
serge_girard
Posts: 3166
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: GetFile

Post by serge_girard »

Thanks Erik,


I allreayd adapted your previous exemple and this works fine! And maybe better because a grid can hold nearly-unlimited items.

Bedankt !

Serge
There's nothing you can do that can't be done...
Post Reply