Autor Beitrag
christian_m
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 26



BeitragVerfasst: Fr 18.04.08 20:46 
Hi @ all!

Ich bin gerade dabei ein Textverarbeitungsprogramm zu schreiben und stoße auf folgendes Problem:
In einer Ini-Datei sind Sections, Schlüssel und Werte nach der Form
>[Section]
>Schlüssel1=Wert1
>Schlüssel2=Wert2
>Schlüssel3=Wert3
>...
gespeichert.
Nun möchte ich nicht nur einen Wert, sondern einen Schlüssel (+Wert) aus der Datei entfernen:
ausblenden Delphi-Quelltext
1:
2:
 if (ini.valueExists (Section, Schlüssel2)) then
   ini.deleteSectionValue (Schlüssel2);


Das Ergebnis sollte dann so aussehen:

>[Section]
>Schlüssel1=Wert1
>Schlüssel3=Wert3
>...

Dies funktioniert jedoch nicht (deleteSectionValue gibt es nicht), da man entweder einen Wert oder nur eine ganze Sektion löschen kann

Kann mir jemand helfen?

mfg Christian
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: Fr 18.04.08 21:06 
Dann lösch den Wert?
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Sa 19.04.08 00:47 
Moin!

user profile iconchristian_m hat folgendes geschrieben:
Dies funktioniert jedoch nicht (deleteSectionValue gibt es nicht)
Die Methode heißt ja auch DeleteKey(). :idea: ;)

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.