Page 1 of 1

Fastest way to search for text in RVF files?

Posted: Sun Apr 15, 2018 2:34 pm
by PeterPanino
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?

Re: Fastest way to search for text in RVF files?

Posted: Sun Apr 15, 2018 4:45 pm
by Sergey Tkachenko
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.