Autor Beitrag
lord.paddington
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 76



BeitragVerfasst: So 27.03.05 20:52 
Hallo!

Lösche die Memobox und beschreibe dann die ersten 3 Zeilen mit Inhalt.
Danach möchte ich die 3 Zeilen speichern.

folgender Code stimmt mich aber nicht zufrieden:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
//Memo wird gelöcht
memo1.clear;
//Memo wird mit Inhalt beschrieben
memo1.lines[0] := DateToStr(Now) + '  ' + Variable;
memo1.lines[1] := ComboBox1.Items[0]+';'+ComboBox2.Items[0]+';'+ComboBox3.Items[0]+';'+ComboBox4.Items[0]+';'+ComboBox5.Items[0];
memo1.lines[2] := Edit1.Text;
//Memo speichern
memo1.lines.savetofile('Datei'+'.txt');


Das Problem ist, dass die Datei nach dem 1. Abspeichern nie erneuert wird, obwohl definitiv neue Inhalte der Comboboxen vorhanden sind.

Liegt es etwa an dem ...Items[0]?

Wie speichere ich denn die aktuelle Auswahl ab?

Danke

Moderiert von user profile iconGausi: Code- durch Delphi-Tags ersetzt.
Moderiert von user profile iconGausi: Topic aus CLX / Delphi Language (Object-Pascal) verschoben am Mo 28.03.2005 um 09:56

_________________
pfutsch ist hin und hin ist pfutsch
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: So 27.03.05 20:54 
Mach doch:

ausblenden Delphi-Quelltext
1:
2:
Memo1.Lines.Add(DateToStr(Now) + '  ' + Variable);
...

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
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: Mo 28.03.05 08:56 
Hallo,

Dir sollte wohl combobox1.Items[combobox1.itemindex]; weiterhelfen.

_________________
We are, we were and will not be.
csa
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22

Win XP
Delphi 2005 Prof.
BeitragVerfasst: Mo 28.03.05 10:04 
nach memo1.clear gibt es keine erste Zeile mehr, daher ist der Zugriff mittels memo1.lines[0] ungültig. memo1.lines[0] := ... durch memo1.lines.Add(...) ersetzen, dann sollte es klappen.