Autor Beitrag
stigge Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 426

WinXP
Delphi 2007
BeitragVerfasst: Sa 17.03.07 17:34 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
var s: string;
    liste: tstringlist
    jetzt: integer;
    anzahl: integer;
.....
jetzt := 0;
anzahl := listbox2.Items.Count;
while jetzt < anzahl do
begin
s := listbox2.Items[jetzt];
FillID3TagInformation(s, edit1, edit2, edit3, edit4, edit5, edit6);
if liste.IndexOf(edit2.text) = -1 then //hier ist der Fehler, nur welcher?
begin
liste.add('---> '+edit2.text);
end else
begin
indexnummer := liste.IndexOf(edit2.Text);
liste.Insert(indexnummer, '---> '+edit2.text);
end;
jetzt := jetzt + 1;
if jetzt = anzahl then
begin
liste.SaveToFile('liste.dat');
end;
end;
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Sa 17.03.07 17:34 
Du musst vor dem Benutzen der Stringlist eine Instanz erstellen und diese am Ende wieder freigeben.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
//Erstellen
liste := TStringlist.Create;
//Am Ende wieder aus'm Speicher räumen
FreeAndNil(liste);

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
stigge Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 426

WinXP
Delphi 2007
BeitragVerfasst: Sa 17.03.07 17:38 
user profile iconMarco D. hat folgendes geschrieben:
Du musst vor dem Benutzen der Stringlist eine Instanz erstellen und diese am Ende wieder freigeben.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
//Erstellen
liste := TStringlist.Create;
//Am Ende wieder aus'm Speicher räumen
FreeAndNil(liste);

Ich bekomme trotzdem noch den gleichen Fehler in der gleichen Zeile!
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Sa 17.03.07 17:45 
Wie lautet denn der Fehler?

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
stigge Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 426

WinXP
Delphi 2007
BeitragVerfasst: Sa 17.03.07 17:50 
Verdammt komplizierter Fehler, irgendwas mit "Fehler bei Lesen von $0000000" oder so ähnlich und zwar immer da, wo ich indexof auslese.
stigge Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 426

WinXP
Delphi 2007
BeitragVerfasst: Sa 17.03.07 17:59 
Hat sich erledigt.
Ihn hat das Edit2.text gestört.
if liste.IndexOf(edit2.text) = -1 then
ich habs einfach über eine Variable gemacht.