VFP also has an embedded full project search, doing what you want to do with all source files of the loaded and active project. It's called code references and is based on filer.dll, a more general purpose file search DLL. You are allowed to redistribute this. See
"...you can distribute filer.dll and it's companion files..."
I think that wasn't always so, as faq184-139 offers an alternative under the assumption you can' distribute filer. Also faq184-140 shows a solution without filer.
Anyway filer.dll needs a setup with COM registration but otherwse is a few lines, as a slight modification of the sample code in the help topic:
Code:
oMyFiler = CREATEOBJECT('Filer.FileUtil')
oMyFiler.SearchPath = HOME() && Point search path to home directory.
oMyFiler.FileExpression = '*.TXT' && Specify text file search. && might change to *.* or *.csv
oMyFiler.SearchText1 = "filer.dll" && also see the help topic about more search options
oMyFiler.Find(0) && again the help tells what 0 means here
FOR nFileCount = 1 TO oMyFiler.Files.Count
? oMyFiler.Files.Item(nFileCount).Name
ENDFOR
That by the way shows filer is found in the redist.txt file about all redistributable files.
That said you don't need to justify any question by assuring you searched the whole forum. It doesn't matter at all. But if you say so, it could get embarrassing.
But that's it, I'm sure nobody will blame you for not searching an already given answer first.
Welcome and I even believe you searched, just not the right terms or a too specific question. Maybe a little recommendations for that are welcome too? Simple search terms still lead the way. In the FAQ section use CTRL+F to search and highlight the titles of FAQs with "file" in them, that would have been one way. It's the central term for search within a file, also "search" highlights those FAQs.
You may also use Windows Search Index, if you didn't turn that off and if you add your main folder to it, it'll at least index all file types which have a IFilter, which includes txt and csv. I gave a sample in thread184-1452607
This sample finds more files containing "filer.dll", as it looks in the index of all files and still works in Win7 and 8:
Code:
Local loConn, loRS, loPath, loFile, lcFilename
loConn=CREATEOBJECT("adodb.connection")
loConn.ConnectionString="Provider=Search.CollatorDSO;Extended Properties='Application=Windows';"
loConn.Open()
loRs = loConn.Execute("SELECT System.ItemFolderPathDisplay, System.Filename FROM SystemIndex WHERE CONTAINS('filer.dll')")
loRS.Movefirst()
Do While Not loRS.EOF
loPath = loRs.Fields.Item("System.ItemFolderPathDisplay")
loFile = loRs.Fields.Item("System.Filename")
lcFilename = Addbs(loPath.Value)+loFile.Value
? lcFilename
loRS.Movenext()
EndDo
Bye, Olaf.