Autor Beitrag
Danny W.
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 296

Windows XP, WIN 2000
Delphi 2005 PE
BeitragVerfasst: Mo 06.11.06 13:06 
Hallo,
ich habe einen Text in meinem Memo-Feld

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
03.11.2006,03.11.2006,13:55:00,13:55:30,Bildergalerie.pps
03.11.2006,03.11.2006,13:59:00,13:59:30,Hoffmann.pps
03.11.2006,03.11.2006,13:57:00,13:57:30,Moellering.pps
03.11.2006,03.11.2006,13:58:00,13:58:30,Busemann.pps
03.11.2006,03.11.2006,13:56:00,13:56:30,Citipost.pps
03.11.2006,03.11.2006,13:52:00,13:52:30,Seiters.pps
03.11.2006,03.11.2006,13:53:00,13:53:30,BegrüßungWulff.pps
[b]00.00.0000,00.00.0000,00:00:00,00:00:00,Standart.pps[/b]
03.11.2006,03.11.2006,13:51:00,13:51:30,Rotary.pps
[b]00.00.0000,00.00.0000,00:00:00,00:00:00,Standart.pps[/b]


Eine bestimmte zeile soll jetzt mit

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
      var 
  neuer_datensatz, leer : string;
  ...
  neuer_datensatz := (datum_von+','+datum_bis+','+zeit_von+','+zeit_bis+','+programm);
  leer:='00.00.0000,00.00.0000,00:00:00,00:00:00,Standart.pps';
  Memo1.Text:=StringReplace(memo1.text, leer, neuer_datensatz, [rfReplaceAll]);


ersetzt werden. Soweit auch kein Problem. Allerings soll der Text nur einmal ersetzt werden und zwar da wo er zum ersten mal vorkommt! Das Ergebnis ist dieses hier:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
03.11.2006,03.11.2006,13:55:00,13:55:30,Bildergalerie.pps
03.11.2006,03.11.2006,13:59:00,13:59:30,Hoffmann.pps
03.11.2006,03.11.2006,13:57:00,13:57:30,Moellering.pps
03.11.2006,03.11.2006,13:58:00,13:58:30,Busemann.pps
03.11.2006,03.11.2006,13:56:00,13:56:30,Citipost.pps
03.11.2006,03.11.2006,13:52:00,13:52:30,Seiters.pps
03.11.2006,03.11.2006,13:53:00,13:53:30,BegrüßungWulff.pps
[b]05.06.2007,05.45.2008,21:00:00,22:00:00,blubb.pps[/b]
03.11.2006,03.11.2006,13:51:00,13:51:30,Rotary.pps
[b]05.06.2007,05.45.2008,21:00:00,22:00:00,blubb.pps[/b]


soll aber so sein

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
03.11.2006,03.11.2006,13:55:00,13:55:30,Bildergalerie.pps
03.11.2006,03.11.2006,13:59:00,13:59:30,Hoffmann.pps
03.11.2006,03.11.2006,13:57:00,13:57:30,Moellering.pps
03.11.2006,03.11.2006,13:58:00,13:58:30,Busemann.pps
03.11.2006,03.11.2006,13:56:00,13:56:30,Citipost.pps
03.11.2006,03.11.2006,13:52:00,13:52:30,Seiters.pps
03.11.2006,03.11.2006,13:53:00,13:53:30,BegrüßungWulff.pps
[b]05.06.2007,05.45.2008,21:00:00,22:00:00,blubb.pps[/b]
03.11.2006,03.11.2006,13:51:00,13:51:30,Rotary.pps
00.00.0000,00.00.0000,00:00:00,00:00:00,Standart.pps


hoffe auf hilfe :)

mfG

_________________
"Ich find den Fehler nicht. Der Artist wird immer als "Syntax Error" gezeigt :("
"Ach verdammt, der Artist heißt wirklich "Syntax Error" xD"
azubi_20
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 593

WinXP SP2, Ubuntu 8.4
D7 Enterp., D2005 Prof., Java (Eclipse 3.4.0)
BeitragVerfasst: Mo 06.11.06 13:12 
rfReplaceAll muss raus (denn es ersetzt alles :-) )
Danny W. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 296

Windows XP, WIN 2000
Delphi 2005 PE
BeitragVerfasst: Mo 06.11.06 13:14 
Oh mein Gott! Kein wunder das ich in der Boardsuche nichts gefunden habe...danke und sorry :) *shameonme*

mfG

_________________
"Ich find den Fehler nicht. Der Artist wird immer als "Syntax Error" gezeigt :("
"Ach verdammt, der Artist heißt wirklich "Syntax Error" xD"