Autor Beitrag
sabi_14
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 40



BeitragVerfasst: Do 05.06.08 10:22 
Hallo zusammen,
ich hoffe, dass mir jemand helfen kann.
Also, ich habe ein INI-File, welches etwa so aussieht:

[Test]
A: bla
B: blubb
C: glugg

so, jetzt möchte ich gerne die Zeilen A, B und C in aus dem INI-File herauslesen und in einem Memo-Feld anzeigen.
ich habe schon einiges versucht und bin kläglich gescheitert.

Noch ein Zusatz.
Ich habe ein frmMain, darin kann ich die Section [Test] auswählen. Danach übergebe ich diese Section an die Prozedure SetSection, welche sich in einem Frame namens frmAllgemein befindet. Und in dieser Prozedure möchte ich dass machen, dass ich die Daten in das Memo schreibe.

Danke schonmal im voraus.
Grüsse
Sabi
Martok
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 3661
Erhaltene Danke: 604

Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
BeitragVerfasst: Do 05.06.08 10:30 
Muss das mit : (Doppelpunkt) sein? Mit = könntest du einfach TIniFile benutzen.

_________________
"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."
sabi_14 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 40



BeitragVerfasst: Do 05.06.08 10:32 
Ich verwende scho TIniFile.
und ja natürlich, es sind keine : sondern = zeichen.
aber ich habe jetzt das problem, dass ich nicht weiss, wie ich jetzt alle zeile zusammen herauslesen kann und dann in ein Memo-Feld schreiben kann.

Gruss
Sabi
Martok
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 3661
Erhaltene Danke: 604

Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
BeitragVerfasst: Do 05.06.08 10:37 
Du könntest alle Items in eine Stringlist einlesen.
Dieser setzt du dann .NameValueSeparator:= ':', dann kannst du per Names/Values drauf zugreifen. GGf den Wert noch mit Trim von Leerzeichen befreien.

_________________
"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."
sabi_14 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 40



BeitragVerfasst: Do 05.06.08 10:39 
OK, danke.
ich werde dies gleich mal ausprobieren.

Gruss
Sabi