Autor Beitrag
X-Cape
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32

Win XP Prof.
Delphi 7 PE
BeitragVerfasst: Fr 06.10.06 13:29 
Hi,
neue Frage :wink:
Und zwar wie Lese ich zum Beispiel aus einer INI folgendes in eine Listbox:

[option1]
blabla=1

[option2]
bluppblupp=2


Wie komme ich an Option1, Option2 usw?
Einige Teilschritte kenn ich:
ausblenden Delphi-Quelltext
1:
MainForm.Listbox.Items.Add //damit wird das Hinzufügen in die Listbox gemacht					

MFG,
X-Cape
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Fr 06.10.06 13:33 
Moin!

Schlechtes Konzept, besser so: ;)
ausblenden Quelltext
1:
2:
3:
4:
[Optionen]
Count=2
Option1=blahblah
Option2=blubb

Besser nicht in den Sektionsnamen Informationen ablegen, sondern nur in Schlüsseln unterhalb. ;)

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
X-Cape Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32

Win XP Prof.
Delphi 7 PE
BeitragVerfasst: Fr 06.10.06 13:38 
Titel: Antwort
Hi,
ja das ginge nur:
Die Unteroptionen unter Option1 und Option2 haben die gleichen Namen und sind für
getrennte Informationen gedacht.
Das ist das Problem (u.a.).

Ich mache nämlich folgendes:
Ich bastle zurzeit einen Vokabeltrainer (beliebte Aufgabe)
und speichere Sprache, Lektion und Vokabel in einer INI.
Ich hab mir das so gedacht:

Deutsch-Englisch.ini -> Sprachname: Deutsch-Englisch
[Lektion1] -> Lektionname: Lektion1
Deutsch=German -> Vokabel Deutsch entspricht German
Hab mal ein Bild angehängt, wie das aussieht bisher.
Grüße,
X-Cape
Einloggen, um Attachments anzusehen!


Zuletzt bearbeitet von X-Cape am Fr 06.10.06 13:45, insgesamt 1-mal bearbeitet
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Fr 06.10.06 13:39 
Moin!

Dann erweiterst du einfach die Schlüsselmenge: ;)
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
[Optionen]  
Count=2  
Option1=blahblah  
Value1=123
Option2=blubb
Value2=456

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
X-Cape Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32

Win XP Prof.
Delphi 7 PE
BeitragVerfasst: Fr 06.10.06 13:46 
Titel: Problembeschreibung
Hi,
mein Problem hab ich grad oben nochmal expliziter dargestellt.

Gibt es eine Methode oder sollte ich mein Konzept überdenken?
Danke für die Hilfe,
X-Cape
Einloggen, um Attachments anzusehen!
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Fr 06.10.06 14:17 
Moin!

Vorschlag:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
[Global]
Lang1=Deutsch
Lang2=Englisch
Autor=ich
Lektionen=2

[Lektion1]
Name=für Anfänger
Count=2
Lang1_1=Baum
Lang2_1=tree
Lang1_2=Blatt
Lang2_2=leaf

[Lektion2]
Name=die Nächste
Count=1
Lang1_1=DNS
Lang2_1=DNA

;)

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
X-Cape Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32

Win XP Prof.
Delphi 7 PE
BeitragVerfasst: Fr 06.10.06 14:21 
Titel: "That's it", wie der Engländer sagt
Ja genau, das ist es, hmm, :roll: warum komm ich selber nicht drauf?
Trotzdem danke jetzt :idea: leuchtets mir ein.

Thx,
X-Cape
wulfskin
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1349
Erhaltene Danke: 1

Win XP
D5 Pers (SSL), D2005 Pro, C, C#
BeitragVerfasst: Fr 06.10.06 14:58 
Hallo,

was du suchtest, war ReadSections. Es empfiehlt sich aber der Aufbau von Narses. Trotzdem kann diese Funktion oft sehr hilfreich sein.

Gruß Hape!

_________________
Manche antworten um ihren Beitragszähler zu erhöhen, andere um zu Helfen.