Page 1 of 2

Enhancements to GetFile() and PutFile()

Posted: Tue Oct 28, 2014 10:32 am
by kcarmody
I've developed enhanced versions of GetFile() and PutFile(). I've added an extra parameter to each one to control the initial file filter that the user sees. This is a numeric parameter that is an index into the filter array. Examples:

Code: Select all

GetFile({{'RTF files', '*.rtf'}, {'Text files', '*.txt'}},,,,, 2)
displays the 'Text files' filter initially instead of 'RTF files'

Code: Select all

nIndex := 2
PutFile({{'RTF file', '*.rtf'}, {'Text file', '*.txt'}},,,,,, @nIndex)
displays the 'Text files' filter initially and sets nIndex to 1 if the user selects an RTF file.

I did this mainly so I could distinguish between two filters with the same extension, e.g.

Code: Select all

{{'RTF file', '*.rtf'}, {'Unicode text file', '*.txt'}, {'ANSI text file', '*.txt'}}
But I find it is also nice to initially select the filter that the user last used.

I've tested these enhancements and put proposed revisions on my site at http://kevincarmody.com/hmg/SOURCE/ . I've also posed proposed revisions to the documentation of these two functions at http://kevincarmody.com/hmg/DOC/ .

Kevin

Re: Enhancements to GetFile() and PutFile()

Posted: Tue Oct 28, 2014 10:45 am
by danielmaximiliano
Kevin

Gracias por el trabajo desarrollado ...

Re: Enhancements to GetFile() and PutFile()

Posted: Tue Oct 28, 2014 11:27 am
by esgici
Good enhancements :arrow:

Thanks Mr. Carmody :)

Happy HMG'ing :D

Re: Enhancements to GetFile() and PutFile()

Posted: Tue Oct 28, 2014 11:49 am
by bpd2000
Thanks Mr. Carmody for enhancement

Re: Enhancements to GetFile() and PutFile()

Posted: Tue Oct 28, 2014 11:58 am
by serge_girard
Thanks Kevin !

Serge

Re: Enhancements to GetFile() and PutFile()

Posted: Tue Oct 28, 2014 3:34 pm
by Rathinagiri
Very useful enhancement.

Re: Enhancements to GetFile() and PutFile()

Posted: Tue Oct 28, 2014 5:05 pm
by srvet_claudio
Very nice, thanks Kevin

Re: Enhancements to GetFile() and PutFile()

Posted: Tue Oct 28, 2014 7:16 pm
by Javier Tovar
Excelente Kevin,

Saludos

Re: Enhancements to GetFile() and PutFile()

Posted: Wed Oct 29, 2014 8:27 am
by Agil Abdullah
Kevin,

Excellent sharing.

Salam Dari Jakaarta

Re: Enhancements to GetFile() and PutFile()

Posted: Wed Oct 29, 2014 5:43 pm
by kcarmody
Thank you everyone for your kind words. I feel very welcome here. :)