I have a TMemo which contains quite a lot of texts, 80M (about 400K lines).
The TMemo is set with WordWrap = FALSE, there is no need to find texts that wrapped in 2 lines.
I need a fast way to find a text, from the beginning, and also find next.
So, I put a TEdit for putting the text to find and a TButton to find the text in the TMemo.
I was thinking to use Pos(), checking line by line, but that will be slow. And I don't know how to determine the TMemo.Lines[index] for current cursor position.
Anyone can come up with solution?
Thanks
UPDATE:
I found a solution from here: Search thru a memo in Delphi?
The SearchText() function works, fast, and very fast. Took couple of seconds to search unique string at the bottom end.
EM_FINDTEXT
which is wrapped in in theFindText
method ofTRichEdit
. – David HeffernanPos
function withTMemo.Lines.Text
property should be faster; though it can possibly find wrapped substring too, I don't think that is a problem. – kludg