Which is the fastest way to search for a simple text string in a bunch of .RVF files?
Is there a specialized function for this or do I have to load each RVF file in a TRichView and search the text in it?
Fastest way to search for text in RVF files?
-
- Posts: 57
- Joined: Tue Jul 13, 2010 10:50 pm
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: Fastest way to search for text in RVF files?
There are no functions for searching text in RVF files, sorry. You need to load them one by one.
The slowest procedure is formatting, and SearchText method requires a formatted document. So, if you need a fast search, avoid using SearchText, and create your own procedure for searching text in TRichView. As a sample, you can use code enumerating all text items, from here: https://www.trichview.com/help/controls ... items.html
If you expect that search will be performed often, I suggest to saving a text-only copies of documents. You can use functions from RVLinear unit: https://www.trichview.com/help/idh_rvlinear.html
Text returned by RVGetTextRange has 1:1 correspondence to the document. So, if you find a text string in this text, you can select it in the document.
The slowest procedure is formatting, and SearchText method requires a formatted document. So, if you need a fast search, avoid using SearchText, and create your own procedure for searching text in TRichView. As a sample, you can use code enumerating all text items, from here: https://www.trichview.com/help/controls ... items.html
If you expect that search will be performed often, I suggest to saving a text-only copies of documents. You can use functions from RVLinear unit: https://www.trichview.com/help/idh_rvlinear.html
Text returned by RVGetTextRange has 1:1 correspondence to the document. So, if you find a text string in this text, you can select it in the document.