Autor Beitrag
kingsusu
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 20



BeitragVerfasst: Mo 28.12.09 13:01 
Hallo Leute. Ich will mehr als nur ein "Datenpacket" in meine Ini Datei speichern.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
filename :=  Extractfilepath (application.ExeName) + 'test.ini';
   WriteToIni (Filename,'Myvars','Überschrift',eduber.Text);
   WriteToIni (Filename,'Myvars','Beschreibung',edmem.Text);
   WriteToIni (Filename,'Myvars','Zeit',TimeToStr(pickerzeit.Time));
   WriteToIni (Filename,'Myvars','Datum',DateToStr(pickerdatum.date));


Wie mache ich das? Gehört eine Art schleife drum rum?

Danke für hilfreiche Antworten.
Xentar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2077
Erhaltene Danke: 2

Win XP
Delphi 5 Ent., Delphi 2007 Prof
BeitragVerfasst: Mo 28.12.09 13:40 
Auch wenn ich nicht enau weiß, was du als "Datenpaket" bezeichnest, behaupte ich mal: Ja.

Übrigens: Warum erzeugst du nicht einmal eine Ini Instanz, und arbeitest dann mit dieser? Deine Methode WriteToIni macht das sicher jedesmal einzeln - somit hast du extrem viel overhead. Jedesmal Instanz erzeugen -> EINEN Wert speichern -> Instanz zerstören, und das für jeden Eintrag..

_________________
PROGRAMMER: A device for converting coffee into software.