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

Windows XP, WIN 2000
Delphi 2005 PE
BeitragVerfasst: Fr 03.11.06 12:27 
hmm..komischerweise klappt das bei mir jetzt nicht mit dem suchen und ersetzen einer textdatei

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
procedure TForm1.zeilendeleter;
var i:integer;
liste:TStringList;
begin
  liste := TStringList.Create;
  liste.LoadFromFile('daten\daten.txt');

  for i := 0 to liste.Count - 1 do begin
    if Pos(Substr, liste[i]) = fullstring.caption then
      liste[i] := 'LEER';
  end;
end;


fullstring caption soll gesucht werden und durch 'LEER' ersetzt werden :)

//Offtopic
@jasocul: bist du heute abend auch aufm Taste of Chaos? :)


mfG
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6393
Erhaltene Danke: 147

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Fr 03.11.06 12:38 
Kann auch nicht funktionieren, da Pos als Ergebnis eine Zahl liefert und Du diese mit einem String vergleichst.

[OT]Keine Ahnung was das ist, aber den Geschmack von Chaos habe ich jedesmal, wenn ich in die Zimmer meine Kinder sehe. :zwinker: [/OT]
Danny W. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 296

Windows XP, WIN 2000
Delphi 2005 PE
BeitragVerfasst: Fr 03.11.06 12:57 
^^ Kenn ich von meinem kleinen Bruder (3 Jahre alt) ^^

Taste of Chaos ist ein ziemlich lustiges Konzert :) vielleicht aber nichts für einen Mann in deiner Altersklasse *frechwerd* :P


Hmm..stimmt...dafür war pos ja gut *aufdeineseiteguck* ich mach das mal mit stringreplace, dankesehr ;)

mfG
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6393
Erhaltene Danke: 147

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Fr 03.11.06 13:07 
user profile iconMantis1987 hat folgendes geschrieben:
Taste of Chaos ist ein ziemlich lustiges Konzert :) vielleicht aber nichts für einen Mann in deiner Altersklasse *frechwerd* :P
Gaaanz vooorsichtig!! Mein letzte Heavy-Metal-Konzert ist zwar schon 3 oder 4 Jahre her, aber ich fühle mich trotzdem noch nicht zu alt für sowas. Bin halt nur nicht mehr auf dem Laufenden. :wink:
Danny W. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 296

Windows XP, WIN 2000
Delphi 2005 PE
BeitragVerfasst: Fr 03.11.06 13:25 
Da fühlt sich jemand angegriffen ^^

btw.

mein aktueller code ist jetzt

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
procedure TForm1.zeilendeleter;
var i:integer;
liste:TStringList;
begin

if zeile_delete = true then
begin
  liste := TStringList.Create;
  liste.LoadFromFile('daten\daten.txt');
        for i := 0 to liste.count-1 do
         memo3.lines.add(liste.strings[i]);

         if fullstring.caption <> '' then
         StringReplace(memo3.text, fullstring.caption, 'LEER', [rfReplaceAll]);
  zeile_delete:=false;
  liste.Text := memo3.text;
  liste.SaveToFile('daten/daten.txt');
end;
end;


und das sollte ja laufen :)

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

Windows XP, WIN 2000
Delphi 2005 PE
BeitragVerfasst: Fr 03.11.06 14:44 
in meinem memo3 feld stehen jetz drin:

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
03.11.2006,03.11.2006,13:54:00,13:54:30,BegrüßmonKult.pps
03.11.2006,03.11.2006,13:51:00,13:51:30,Rotary.pps
03.11.2006,03.11.2006,13:50:00,13:50:30,Querbeet.pps


aber
ausblenden Delphi-Quelltext
1:
StringReplace(memo3.text, '03.11.2006,03.11.2006,13:55:00,13:55:30,Bildergalerie.pps''LEER', [rfReplaceAll]);					


funktioniert doch nicht :/

liebe Grüße,
Mantis

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

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Fr 03.11.06 14:48 
user profile iconMantis1987 hat folgendes geschrieben:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
procedure TForm1.zeilendeleter;
var i:integer;
liste:TStringList;
begin

if zeile_delete = true then
begin
  liste := TStringList.Create;
  liste.LoadFromFile('daten\daten.txt');
        for i := 0 to liste.count-1 do
         memo3.lines.add(liste.strings[i]);

         if fullstring.caption <> '' then
         Memo3.Text:=StringReplace(memo3.text, fullstring.caption, 'LEER', [rfReplaceAll]);
  zeile_delete:=false;
  liste.Text := memo3.text;
  liste.SaveToFile('daten/daten.txt');
end;
end;

StringReplace ist keine Procedure mit var-Parameter sondern eine Funktion, darum einfach das ge-highlightete hinzufügen ;)

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
Danny W. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 296

Windows XP, WIN 2000
Delphi 2005 PE
BeitragVerfasst: Fr 03.11.06 14:51 
Jay Eff du bist mein Held...gleich neben GTA-Place ^^

liebe Grüße,
Mantis

_________________
"Ich find den Fehler nicht. Der Artist wird immer als "Syntax Error" gezeigt :("
"Ach verdammt, der Artist heißt wirklich "Syntax Error" xD"
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Fr 03.11.06 15:14 
GTA-Place > JayEff - aber lassen wir das xD.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Fr 03.11.06 15:28 
:!:
/me wirft GTA-Place einen Handschuh ins Gesicht!
/me guckt seeeehr grimmig: GRRRRRRR
Aber lassen wir das OffTopic.
Der selbe Fehler mit StringReplace ist mir auch mal passiert... Tja, da wundert man sich dann erstmal 30 min warum nix passiert... *g*

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
Danny W. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 296

Windows XP, WIN 2000
Delphi 2005 PE
BeitragVerfasst: Fr 03.11.06 15:46 
jo stimmt schon...aber umso erleichterter ist man, wenn man den fehler dann behoben hat...wenns dann auch noch so ein fehler ist :)

mfG und schönes WE noch

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