Enhancements to GetFile() and PutFile()
Posted: 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: displays the 'Text files' filter initially instead of 'RTF files' 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. 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
Code: Select all
GetFile({{'RTF files', '*.rtf'}, {'Text files', '*.txt'}},,,,, 2)
Code: Select all
nIndex := 2
PutFile({{'RTF file', '*.rtf'}, {'Text file', '*.txt'}},,,,,, @nIndex)
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'}}
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