Autor Beitrag
foxy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 814

Ubuntu, Gentoo
C++, PHP, Java, Ruby, Perl (Eclipse)
BeitragVerfasst: Mo 14.07.03 11:31 
guden

also ich hatte hier ma gefragt, wei ich in einem RichEdit nach ne text suchen kann und makeiren das geht ja aber wie kann ich weitersuchen??? O_o
ich war mal dann so schlauf, die zeile an dem er stehen geblieben ist, also Globale variable zu speichern und die startpos dann ab der zeile zu setzten aber kein erfolg .... bringt imma nur das erste gefundene wort hier der code

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
Function TfrmMain.SearchAgainText(RichEdit :TJvxRichEdit; SearchText: String): Boolean;
var
  Startpos, Position, EndPos: Integer;
Begin
  StartPos:=Zeile;
  With RichEdit do
  begin
    Endpos:= Length(RichEdit.Text);
    Lines.BeginUpdate;
    while findText(SearchText, StartPos, Endpos, [stMatchCase]) <>-1 do
    Begin
      Endpos := Length(RichEdit.Text)- StartPos;
      Position:= Findtext(SearchText, StartPos, EndPos,[stMatchCase]);
      inc(StartPos, Length(SearchText));
      SetFocus;
      Selstart := Position;
      SelLength := Length(SearchText);
    end;
    lines.EndUpdate;
  end;
end;

_________________
"Only wimps use tape backup: real men just upload their important stuff on ftp, and let the rest of the world mirror it." (Linus Torvalds)
OperatingSystem Laptop (Ubuntu Hardy)
patrick
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1481

WIN2k, WIN XP
D6 Personal, D2005 PE
BeitragVerfasst: Mo 14.07.03 11:40 
man öffne delphi,
drücke F1,
suche nach dem begriff
ausblenden Delphi-Quelltext
1:
findnext					


alternativ:
im DF suchen oder diese Tutorial lesen:
www.delphi-forum.de/viewtopic.php?t=1107

_________________
Patrick
im zweifelsfall immer das richtige tun!!!
foxy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 814

Ubuntu, Gentoo
C++, PHP, Java, Ruby, Perl (Eclipse)
BeitragVerfasst: Mo 14.07.03 11:43 
rofl meinste das habe ich noch nich gemacht oder was? :PPPP

ich bin nich von gestern


edit:
gut dazu muss ich noch sagen das ich ungern mit findnext arbeiten will sondern eher mit der methoden des richedits

_________________
"Only wimps use tape backup: real men just upload their important stuff on ftp, and let the rest of the world mirror it." (Linus Torvalds)
OperatingSystem Laptop (Ubuntu Hardy)
Stevie
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 85

Windows 7
Delphi XE Professional
BeitragVerfasst: Mo 14.07.03 12:10 
Hi,
das müsste doch so gehen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
begin
  with RichEdit do
  begin
    SelStart := 0;
    repeat
      Position := FindText(SearchText, 0, GetTextLen, [stMatchCase]);
      if (Position > -1) then
      begin
        SelStart := Position;
        SelLength := Length(SearchText);
      end;
    until (Position = -1);
  end;
end;
patrick
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1481

WIN2k, WIN XP
D6 Personal, D2005 PE
BeitragVerfasst: Mo 14.07.03 16:55 
foxy hat folgendes geschrieben:
rofl meinste das habe ich noch nich gemacht oder was? :PPPP

ich bin nich von gestern


edit:
gut dazu muss ich noch sagen das ich ungern mit findnext arbeiten will sondern eher mit der methoden des richedits

*vielfachumentschuldigungbitten*

_________________
Patrick
im zweifelsfall immer das richtige tun!!!