SearchText problem in RichViewEdit

General TRichView support forum. Please post your questions here
Post Reply
DickBryant
Posts: 148
Joined: Wed Dec 07, 2005 2:02 pm
Contact:

SearchText problem in RichViewEdit

Post by DickBryant »

I'm trying to implement search functionality in a TRichViewEdit in Delphi7. The control is IMemo and contains mixed ANSI and Unicode.

I'm calling the function

if ((MatchCase = 0) and (WholeWord = 0)) then
Found := IMemo.SearchText(EFind.Text,[])

But it does not find words that ARE in the control. In tracing the code in the RVSource code, the function exits at

if Items.Objects[strt]=item then begin
if Down then
inc(strt)
else
dec(strt);
if (strt>=Items.Count) or (strt<0) then exit;

with strt = -1. I.e. it never gets to start the search. Items.Count = 20 when the function starts. The search string, EFind.Text is 'generate'.

What am I missing here?

TIA,

Dick Bryant
Open Window Software
Michel
Posts: 92
Joined: Fri Oct 14, 2005 2:56 pm
Contact:

Post by Michel »

Hi Dick,

I think you may be missing rvseoDown in the SrchOptions parameter, so you are starting the search from the beginning of your document backwards.

Michel
Guest

Post by Guest »

Thanks! That makes sense. I guess I figured it would 'wrap around' and still make one pass from the end of the document backwards.
Post Reply