Autor Beitrag
omega123
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 16



BeitragVerfasst: Do 30.01.03 18:30 
habe folgendes problem

habe eine ini datei, die auch auch soweit ausgelesen bekomme. jetzt nur das problem

aufbau:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
[section] 
bla=bla 
bla=bla 
Text[1]=hallo <- 
Text[2]=du <- 
.. 
..

wie bekomme ich nun die Text[1-?] ausgelesen? denn die anzahl variert mal sind es nur 3 mal sind es aber auch 10. versteht ihr was ich meine?

denn ich kann ja schlecht 200x schreiben
ausblenden Quelltext
1:
2:
memo2.Lines.Add(ini.ReadString(ini.readstring('bla','Text[1]',' ')); 
memo2.Lines.Add(ini.ReadString(ini.readstring('bla','Text[2]',' '));

kann mir jemand helfen?

Moderiert von user profile iconTino: Code-Tags hinzugefügt.
Klabautermann
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Veteran
Beiträge: 6366
Erhaltene Danke: 60

Windows 7, Ubuntu
Delphi 7 Prof.
BeitragVerfasst: Do 30.01.03 18:41 
Hallo,

1. ich würde mich hüten eckige klammern in den Schlüsseln zu verwenden, denn diese haben in INI-Dateien ja besonderer bedutungen.

2. Gucke mal in die Delphi Hilfe unter tIniFile.ReadSection.

Gruß
Klabautermann
Leathl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 276



BeitragVerfasst: Do 30.01.03 18:43 
---


Zuletzt bearbeitet von Leathl am So 16.08.09 13:27, insgesamt 1-mal bearbeitet
Raphael O.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1596


VS 2013
BeitragVerfasst: Do 30.01.03 19:27 
nein so nicht!!!

wenn schon so:
ausblenden Quelltext
1:
...,'text['+inttostr(i)+']',...					

Fiji-Fighter
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Do 30.01.03 19:41 
Was wiederum nicht geht :!: Dann gehts wieder los mit den ' innerhalb eines Strings und der Compiler streikt.

Gruß
Hansa
omega123 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 16



BeitragVerfasst: Fr 31.01.03 09:23 
habe es mittlerweile geschafft.

aber danke für die hilfe
Raphael O.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1596


VS 2013
BeitragVerfasst: Fr 31.01.03 15:43 
hansa hat folgendes geschrieben:
Was wiederum nicht geht :!: Dann gehts wieder los mit den ' innerhalb eines Strings und der Compiler streikt.


Wo is denn da ein " ' " in einem String???
es wird nur der übergebene String aus mehreren einzelnen Strings zusammengesetzt...

ausblenden Quelltext
1:
gesamtstring:='string1'+string2'+string3';					


Fiji-Fighter