Einzelnen Beitrag anzeigen

Benutzerbild von Luckie
Luckie

Registriert seit: 29. Mai 2002
37.621 Beiträge
 
Delphi 2006 Professional
 
#6

Re: Zeilenweise in Datei Schreiben

  Alt 1. Nov 2005, 23:17
Zitat von 3_of_8:
Was genau ist denn ein E/A 105?
delphi-Hilfe:
Zitat:
105 File not open for output Reported by Write or Writeln on a text file if you do not generate a Console application.
Trifft davon was zu:
Zitat:
Reset opens the existing external file with the name assigned to F using the mode specified by the global FileMode variable. An error results if no existing external file of the given name exists or if the file can’t be opened with the current file mode. If F is already open, it is first closed and then reopened. The current file position is set to the beginning of the file.
Und was passiert hier bei:
Delphi-Quellcode:
AssignFile(f,filename);
{$I-}
Reset(f);
if IOResult = 0 then
begin
  for i := 0 to 1 DO
  begin
    WriteLn(f,neueStrings[i]);
  end;
  CloseFile(f);
end
else
  ShowMessage(SysErrorMessage(GetLastError));
{$I+}
Michael
Ein Teil meines Codes würde euch verunsichern.
  Mit Zitat antworten Zitat