hi,
ich suche nach einem bestimmten begriff. zum testen nach n. aber das programm hängt sich auf. wo liegt denn der fehler?
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