Enhancements to GetFile() and PutFile()

Source code related resources

Moderator: Rathinagiri

User avatar
kcarmody
Posts: 152
Joined: Tue Oct 07, 2014 11:13 am
Contact:

Enhancements to GetFile() and PutFile()

Post 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
User avatar
danielmaximiliano
Posts: 2611
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: Enhancements to GetFile() and PutFile()

Post by danielmaximiliano »

Kevin

Gracias por el trabajo desarrollado ...
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Enhancements to GetFile() and PutFile()

Post by esgici »

Good enhancements :arrow:

Thanks Mr. Carmody :)

Happy HMG'ing :D
Viva INTERNATIONAL HMG :D
User avatar
bpd2000
Posts: 1207
Joined: Sat Sep 10, 2011 4:07 am
Location: India

Re: Enhancements to GetFile() and PutFile()

Post by bpd2000 »

Thanks Mr. Carmody for enhancement
BPD
Convert Dream into Reality through HMG
User avatar
serge_girard
Posts: 3161
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Enhancements to GetFile() and PutFile()

Post by serge_girard »

Thanks Kevin !

Serge
There's nothing you can do that can't be done...
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Enhancements to GetFile() and PutFile()

Post by Rathinagiri »

Very useful enhancement.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: Enhancements to GetFile() and PutFile()

Post by srvet_claudio »

Very nice, thanks Kevin
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: Enhancements to GetFile() and PutFile()

Post by Javier Tovar »

Excelente Kevin,

Saludos
User avatar
Agil Abdullah
Posts: 204
Joined: Mon Aug 25, 2014 11:57 am
Location: Jakarta, Indonesia
Contact:

Re: Enhancements to GetFile() and PutFile()

Post by Agil Abdullah »

Kevin,

Excellent sharing.

Salam Dari Jakaarta
Agil Abdullah Albatati (just call me Agil)
Programmer Never Surrender
User avatar
kcarmody
Posts: 152
Joined: Tue Oct 07, 2014 11:13 am
Contact:

Re: Enhancements to GetFile() and PutFile()

Post by kcarmody »

Thank you everyone for your kind words. I feel very welcome here. :)
Post Reply