Autor Beitrag
FrEaKY
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 235


D7
BeitragVerfasst: Mo 26.04.04 10:22 
Hi,

wie kann man einen String ohne Umwege wie zB
ausblenden Delphi-Quelltext
1:
Memo1.Lines.SaveToFile()					

in eine Datei speichern ?
ich hab schon in der Suchfunktion geguckt aber nichts passendes gefunden. Danke schonmal


Zuletzt bearbeitet von FrEaKY am Mo 26.04.04 10:38, insgesamt 2-mal bearbeitet
FrEaKY Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 235


D7
BeitragVerfasst: Mo 26.04.04 10:36 
ah habs schon rausgefunden
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
var f:TextFile;
     s:string;
begin
  s:='test';
  AssignFile(f,OpenDialog1.Filename);
  Rewrite(f);
  Writeln(f,s);
  CloseFile(f);
end;
FrEaKY Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 235


D7
BeitragVerfasst: Mo 26.04.04 18:46 
ich hab noch ne Frage
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
AssignFile(f,'C:\test.txt');
  Rewrite(f);
  Seek(f,6);
  Writeln(f,s);
  CloseFile(f);

bei Seek(f,6); kommt der Fehler Inkompatible Typen. Warum und wie kann ich ihn beheben? thx thx
smiegel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 992
Erhaltene Danke: 1

WIN 7
D7 Prof., C#, RAD XE Prof.
BeitragVerfasst: Mo 26.04.04 19:36 
Hallo,

das geht mit Textdateien so nicht.

Falls Du nur einen String an das Ende der Datei anhängen willst, kannst Du das mit Append machen.
Ansonsten musst Du die Datei als untypisierte Datei deklarieren.

_________________
Gruß Smiegel
Ich weiß, daß ich nichts weiß, aber ich weiß mehr als die, die nicht wissen, daß sie nichts wissen. (Sokrates)
FrEaKY Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 235


D7
BeitragVerfasst: Mo 26.04.04 20:06 
ok danke !! das Append hat mich erstmal viel weitergebracht.