Autor Beitrag
[vsc]PrimeTime
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 20

XP SP0
Delphi 6 Pers. (eng), Delphi 2005
BeitragVerfasst: So 19.10.03 20:20 
Hi Leudz,
Ich will für mein Programm nicht nur edits und captions, sondern auch zwei Memo-Komponenten in einer *.ini datei speichern.

Geht das??

Wenn Ja, wie??

Thxx in advance

PrimeTime

_________________
-=the things you own, own you=-
JESUS SAVES, the rest of you takes full damage!
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: So 19.10.03 21:53 
Zeilenumbrüche werden nicht gehen.
ckurz
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 24

Win XP
Delphi 5
BeitragVerfasst: So 19.10.03 22:19 
Den Inhalt von einem Memofeld kannst du in einer Textdatei speichern (auch mit Zeilenumbrüchen):

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
var textdatei: text;
    i: integer;
begin
   assignfile(textdatei, 'test.txt');
   rewrite(textdatei);
   for i := 1 to memo.lines.count do
      writeln(textdatei, memo.lines[i - 1];         
   closefile(textdatei);
end;
Killmag10
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 297

Suse Linux / DOS / Windows All In One ;)
D4 / D2005
BeitragVerfasst: So 19.10.03 22:31 
ckurz hat folgendes geschrieben:
Den Inhalt von einem Memofeld kannst du in einer Textdatei speichern (auch mit Zeilenumbrüchen):

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
var textdatei: text;
    i: integer;
begin
   assignfile(textdatei, 'test.txt');
   rewrite(textdatei);
   for i := 1 to memo.lines.count do
      writeln(textdatei, memo.lines[i - 1];         
   closefile(textdatei);
end;


Das geht auch viel einfacher !

ausblenden Delphi-Quelltext
1:
memo1.Lines.SaveToFile('C:/test.txt');					


aber das meint er nicht !


mann könnte die ini aber so gestallten:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
[test]
memoz1=Zeile1
memoz2=Zeile2
memoz3=Zeile3
edit1=Zeile1
edit2=Zeile1



Zum schreiben:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
...

For z1:=0 to (memo.Lines.Count-1do ini.WriteString('Test','Memoz'+inttostr(z1),memo.Lines[z1]);

...


Zum lesen:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
...

For z1:=0 to (memo.Lines.Count-1do memo.Lines.add(ini.ReadString('Test','Memoz'+inttostr(z1),'-'));

...

_________________
Mega-inkompetente Computer-ruinierende Organisation spioniert ohne funktionierende Technik
superchatti
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 296

Win XP, Red Hat Linux 7.3
Delphi 6 PE
BeitragVerfasst: Mo 20.10.03 21:52 
es geht aber auch viel einfacher!!!

WIe wäre es mit:

ausblenden Delphi-Quelltext
1:
ini.WriteString('Memo','Text',Memo1.Lines.CommaText);					


Das ist doch einfacher oder??

_________________
mfG Superchatti