Einzelnen Beitrag anzeigen

MarcusB

Registriert seit: 7. Mär 2004
121 Beiträge
 
Delphi 7 Professional
 
#4

Re: Anzahl Zeilen in einem Textfile

  Alt 18. Mai 2004, 08:01
Ist vielleicht umständlich, aber dürfte funzen :

Delphi-Quellcode:
var
  txt: textfile;
  anzahl: integer;
begin
  AssignFile(txt, 'xyz.txt');
  reset(txt);
  while not EOF(txt) do
  begin
    inc(anzahl);
  end;
  CloseFile(txt);
  
  ShowMessage(IntToStr(anzahl));
end;
Gruß

MarcusB
  Mit Zitat antworten Zitat