Autor Beitrag
agent_x
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 62

WIN 2000, Linux Kubuntu 6.06

BeitragVerfasst: Mo 17.09.07 18:36 
Hallo,
also ich hab eine neue Unit angefangen und will das machen::
aus edit1 den text
edit2 den text
und edit3 den text in Ini speichern.
Wie geht das?
Hier ein code:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
procedure TForm3.Button1Click(Sender: TObject);
var ini: TIniFile;
begin
ini:=TIniFile.create(ExtractFilePath(ParamStr(0))+
    'daten/einstellungen.ini');
    ini:=TIniFile.Create('daten/einstellungen.ini');
ini.WriteString('User','Name','edit1.text');
ini.WriteString('User','NachName','edit2.text');
ini.WriteString('User','Land','edit3.text');
ini.free;
Close;
end;

Geht aber nicht in der ini wird edit1.text und co. angezeigt!!!
Brauche dringend hilfe.

MfG agent_x
Andreas L.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Mo 17.09.07 18:41 
Als letzten Parameter darfst du ja auch keinen hardcoded String übergeben, sondern dein Objekt inkl. Eigenschaft das einen String enthält.

Aus ini.WriteString('User','Name','edit1.text'); wird also ini.WriteString('User','Name',edit1.text);

Wieso erstellst du eigentlich 2 Ini-Objekte in eine Variable?
agent_x Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 62

WIN 2000, Linux Kubuntu 6.06

BeitragVerfasst: Mo 17.09.07 19:08 
oh ups ist ein Fehler werde ihn sofort beheben!
und danke