Autor Beitrag
the_immortal
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 78



BeitragVerfasst: Mi 12.10.05 16:23 
Ich möchte ganz simpel ein paar Optionen in einer INI speichern. Ich habe gelesen dass das am besten mit dem TMemIniFile funktioniert.

Hat mir jemand ein kleines Beispiel, leider habe ich nichts gefunden!

PS: Oder gibt es noch eine simplere Möglichkeit?
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Mi 12.10.05 16:27 
Suche in: Delphi-Forum, Delphi-Library TINIFILE
oder einfacher: eine textdatei erstellen und da die werte der reihe nach reinwriteln

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mi 12.10.05 16:31 
Z.B. so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
var
  ini: TMemIni;

//...

  ini := TMeminifile.Create(ChangeFileExt(Application.ExeName, '.ini'));

  Form1.Width := ini.ReadInteger('Fenster','Width',640);
  Form1.Height:= ini.ReadInteger('Fenster','Height',480);
  Form1.Top   := ini.ReadInteger('Fenster','Top',0);
  Form1.Left  := ini.ReadInteger('Fenster','Left',0);

  ini.Free;

Alles weitere über die Delphi Hilfe.

_________________
We are, we were and will not be.
the_immortal Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 78



BeitragVerfasst: Mi 12.10.05 18:53 
Ich lese die Werte aus dem INI in ein TEdit Feld und wenn ich dann im TEdit einen Wert ändere, ich jedoch in der INI nicht speichere und beim Form-Schliessen das TMemIniFile destroye und aus dem Hautform das Form nochmals öffne habe ich immer noch die Werte die ich zuvor editiert habe und nicht die, die eigentlich in der INI gespeichert sind. Destroy entfernt scheinbar das Objekt nicht ganz :(
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Mi 12.10.05 20:07 
Sehr Schwerer Satz.
So wie Ich das verstanden hab ließt Du die Werte warscheinlich nur einmal aus im Form Create vom Hauptformular.
Du musst sie also beim öffnen von Form2 ein zweites mal auslesen.