Enhancements to GetFile() and PutFile()

Source code related resources

Moderator: Rathinagiri

User avatar
kcarmody
Posts: 122
Joined: Tue Oct 07, 2014 11:13 am
Has thanked: 6 times
Been thanked: 16 times
Contact:

Enhancements to GetFile() and PutFile()

Post by kcarmody » Tue Oct 28, 2014 10:32 am

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: 2137
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Has thanked: 154 times
Been thanked: 23 times
Contact:

Post by danielmaximiliano » Tue Oct 28, 2014 10:45 am

Kevin

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

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. : +54901169026142
Telegram Name : DaNiElMaXiMiLiAnO

User avatar
esgici
Posts: 4513
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 389 times
Been thanked: 111 times
Contact:

Post by esgici » Tue Oct 28, 2014 11:27 am

Good enhancements :arrow:

Thanks Mr. Carmody :)

Happy HMG'ing :D
Viva INTERNATIONAL HMG :D

User avatar
bpd2000
Posts: 1077
Joined: Sat Sep 10, 2011 4:07 am
Location: India
Has thanked: 197 times
Been thanked: 96 times

Post by bpd2000 » Tue Oct 28, 2014 11:49 am

Thanks Mr. Carmody for enhancement
BPD
Convert Dream into Reality through HMG

User avatar
serge_girard
Posts: 2332
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 574 times
Been thanked: 124 times
Contact:

Post by serge_girard » Tue Oct 28, 2014 11:58 am

Thanks Kevin !

Serge

User avatar
Rathinagiri
Posts: 5263
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 169 times
Been thanked: 172 times
Contact:

Post by Rathinagiri » Tue Oct 28, 2014 3:34 pm

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: 2044
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Has thanked: 35 times
Been thanked: 146 times
Contact:

Post by srvet_claudio » Tue Oct 28, 2014 5:05 pm

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
Has thanked: 1 time
Been thanked: 2 times

Post by Javier Tovar » Tue Oct 28, 2014 7:16 pm

Excelente Kevin,

Saludos

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

Post by Agil Abdullah » Wed Oct 29, 2014 8:27 am

Kevin,

Excellent sharing.

Salam Dari Jakaarta
Agil Abdullah Albatati (just call me Agil)
Programmer Never Surrender

User avatar
kcarmody
Posts: 122
Joined: Tue Oct 07, 2014 11:13 am
Has thanked: 6 times
Been thanked: 16 times
Contact:

Post by kcarmody » Wed Oct 29, 2014 5:43 pm

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

Post Reply