Zitat von
Jackie1983:
Jetzt möchte ich gerne options_1 bis options_n auslesen und in einer Variable stecken.
Habe es zur Zeit so gelöst
Delphi-Quellcode:
const
options : array[1..4] of String =
(
('options_1'),
('options_2'),
...
);
begin
//...
Text := LowerCase(ini.ReadString('option',options[i],''));
if Text = 'options_1' then
obj.options_1 := text;
//...
Dir ist klar das in Text niemals options_1 auftauchen wird? Sondern nur wert_1, wert_2 usw.?
Was verstehst Du denn unter einer Variablen? Eine Variable pro "Option"?
Delphi-Quellcode:
var
option_1 : string;
option_2 : string;
Text := LowerCase(ini.ReadString('option','option_1',''));
if Text <>'' then option_1 := text;
Text := LowerCase(ini.ReadString('option','option_2',''));
if Text <>'' then option_2 := text;
Gruß
K-H