Microsoft's licensing for Visual FoxPro states that FILER.DLL cannot be distributed with the VFP runtime. It's a shame, because FILER.DLL provides some file search capabilities that are very easy to use.
But all is not lost. If your clients have any of the Microsoft Office applications (Word or Excel, for example), you can tap into the FileSearch object common to the Microsoft Office applications.
The code below demonstrates how to do this:
************************************
* -- demonstrates a file search using the Microsoft Office FileSearch class
* -- these defines are from the Object Browser in the VB editor
#define msoConditionAnytimeBetween 26
if (not type('tcFileSpec') = "C")
return .F.
endif
if (not type('tcStartingDir') = "C")
tcStartingDir = curdir()
endif
* -- IMPORTANT: any of the Microsoft Office applications will suffice, as they
* -- all share the same FileSearch feature; I use Word here
oWord = createobject("Word.Application") && instantiate Word object
* -- normally, of course, these params would be passed
* -- I just threw this in to show this feature
.PropertyTests.Add("Last Modified", msoConditionAnytimeBetween, ;
"07/01/2000", "07/10/2000", msoConnectorAnd)
lnNumFiles = .Execute(msoSortbyFileName)
* -- the .FoundFiles collection now contains a list of found files
* -- .FoundFiles(1) yields the first file name, etc.
for each cFileName in .FoundFiles
* -- obviously, you'd do something a bit more practical
* -- than just listing them
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.