var
i: integer;
SearchOptions: TStringSearchOptions;
Buffer, P: PChar;
Size: Word;
begin
SearchOptions := SearchOptions + [soDown];
SearchOptions := SearchOptions - [soMatchCase];
SearchOptions := SearchOptions - [soWholeWord];
Size := Memo1.GetTextLen;
Buffer := StrAlloc(Size + 1);
try
Memo1.GetTextBuf(Buffer, Size+1);
P := SearchBuf(Buffer,Size,0,0,SearchEdit.Text,SearchOptions);
If (P<>nil) then
begin
ListBox1.Items.Add('SearchBuf(Pointer) found match.');
Memo1.SelStart := P - Buffer;
Memo1.SelLength := Length(SearchEdit.Text);
end;
finally
StrDispose(Buffer);
Wedle tego kodu, jak mi się wydaje w memo powinien byc zaznaczany tekst, z searchedita, natomiast, u mnie koncy się na notce, w listbox'ie że znaleziono, ten wyraz,i to wszystko, co tu jest nie tak?? :/