Текущий архив: 2003.04.21;
Скачать: CL | DM;
Вниз
Работа с диалогом поиска Найти похожие ветки
← →
TSa © (2003-04-09 23:47) [0]Подскажите как быть:
вот теккст процедуры поиска ро большей части из хелпа, то что жирным нет:
procedure TForm1.FindDialog1Find(Sender: TObject);
var
FoundAt: LongInt;
StartPos, ToEnd: Integer;
t:TSearchTypes;
begin
t := [];
with RichEdit1 do
begin
{ begin the search after the current selection if there is one }
{ otherwise, begin at the start of the text }
if SelLength <> 0 then
StartPos := SelStart + SelLength
else
StartPos := 0;
{ ToEnd is the length from StartPos to the end of the text in the rich edit control }
ToEnd := Length(Text) - StartPos;
if (FindDialog1.Options = [frMatchCase]) then t := t + [stMatchCase] else t := t - [stMatchCase];
if (FindDialog1.Options = [frWholeWord]) then t := t + [stWholeWord] else t := t - [stWholeWord];
FoundAt := FindText(FindDialog1.FindText, StartPos, ToEnd, t);
if FoundAt <> -1 then
begin
SetFocus;
SelStart := FoundAt;
SelLength := Length(FindDialog1.FindText);
end
else ShowMessage("Текст ""+FindDialog1.FindText+""не найден")
end;
end;
Обратите внимание на выделеные строки - этот код почемуто всегда содержит лож !!! и соответственно я не могу нормально настроится на устловия поиска ? как быть
← →
TSa © (2003-04-10 18:27) [1]Что не кто не может мне помочь ? :-(
← →
Bel © (2003-04-10 18:45) [2]Попробуй вместо
(FindDialog1.Options = [frMatchCase])
использовать
(frMatchCase in FindDialog1.Options)
← →
Tsa © (2003-04-10 23:45) [3]Bel спасибо всё ОК !!!
Страницы: 1 вся ветка
Текущий архив: 2003.04.21;
Скачать: CL | DM;
Память: 0.47 MB
Время: 0.019 c