Autor Beitrag
Silence
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 58

Win XP Prof
Delphi 7
BeitragVerfasst: Fr 14.04.06 22:39 
hi,

ich suche nach einem bestimmten begriff. zum testen nach n. aber das programm hängt sich auf. wo liegt denn der fehler?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
procedure TForm1.Suche1Click(Sender: TObject);
var position: integer;
    text: string;
    i: integer;
begin
 text := synedit1.Text;
 i:=0;
 while pos('n',text) <> 0 do
 begin
  position := pos('n',text);
  position := position - 1 + i * length('n');
  i := i + 1;
  text := copy(text,1,pos('n',text))+copy(text,pos('n',text)+length('n'),length(text));
  synedit1.SelStart := position;
  synedit1.SelLength := length('n');
 end;
end;


Silence