Dialogos facinho
olá
como usar o dialogo pesquisar e substituir em um memo?
como usar o dialogo pesquisar e substituir em um memo?
Robotizar
Curtidas 0
Respostas
Janderson
03/05/2003
procedure TForm1.FindDialog1Find(Sender: TObject);
var
PosAchada, PosInicial: Integer;
begin
PosInicial := memo1.SelStart + memo1.SelLength;
PosAchada := Pos (Ansilowercase(FindDialog1.FindText),
Copy (Ansilowercase(DBmemo1.Text), PosInicial + 1,
Length (memo1.Text) - PosInicial));
if PosAchada > 0 then
begin
memo1.SetFocus;
memo1.SelStart := PosInicial + PosAchada - 1;
memo1.SelLength := Length(FindDialog1.FindText);
end
else
begin
MessageDlg (´Fim da pesquisa ou texto não encontrado´, mtInformation, [mbOK], 0);
end;
-------------------
Eu só consegui fazer uma rotina para pesquisa. Espero que possa ajudá-lo.
var
PosAchada, PosInicial: Integer;
begin
PosInicial := memo1.SelStart + memo1.SelLength;
PosAchada := Pos (Ansilowercase(FindDialog1.FindText),
Copy (Ansilowercase(DBmemo1.Text), PosInicial + 1,
Length (memo1.Text) - PosInicial));
if PosAchada > 0 then
begin
memo1.SetFocus;
memo1.SelStart := PosInicial + PosAchada - 1;
memo1.SelLength := Length(FindDialog1.FindText);
end
else
begin
MessageDlg (´Fim da pesquisa ou texto não encontrado´, mtInformation, [mbOK], 0);
end;
-------------------
Eu só consegui fazer uma rotina para pesquisa. Espero que possa ajudá-lo.
GOSTEI 0