Autor Beitrag
noctua
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 170



BeitragVerfasst: So 21.11.04 02:44 
also ich habe eine .txt datei die user heisst und da möchte ich jetzt einen text anhängen

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
procedure registrieren(msg:string);
  var f: TextFile;
begin
  Delete(msg, 14);
  MemoAdd(msg + ' hat sich registriert');

  AssignFile(f, 'user.txt');
  ReWrite(f);
  WriteLn(f, msg);
  CloseFile(f);

end;



aber da kommt immer eine fehlermeldung

weiss einer was falsch ist?

Moderiert von user profile iconTino: Code- durch Delphi-Tags ersetzt.

_________________
Am ende sterben eh alle ................
Sprint
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 849



BeitragVerfasst: So 21.11.04 03:28 
noctua hat folgendes geschrieben:
aber da kommt immer eine fehlermeldung

Was für eine Fehlermeldung kommt da? Du weißt aber schon, das nach deinem Sourcecode kein Text angehangen wird, sondern überschrieben wird?

_________________
Ciao, Sprint.
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: So 21.11.04 03:39 
Genau, und deshalb musst du Append statt ReWrite benutzen.

Gruß
Tino