wiem ze moze to jest banał.
Jak dostać liczbe linii w pliku tekstowym :).
Pozdrawiam ;-)
wiem ze moze to jest banał.
Jak dostać liczbe linii w pliku tekstowym :).
Pozdrawiam ;-)
function ile_lini(name: string): integer;
var
f: TextFile;
s: string;
begin
result:=0;
assignfile(f, name);
reset(f);
while not eof(f) do begin
readln(f, s);
inc(result)
end;
closefile(f)
end;
a oto i najgłupszy i najwolniejszy sposób:
function linii(filename:string):integer;
var m:tstringlist;
begin
m:=tstringlist.create;
if fileexists(filename) then
m.loadfromfile(filename) else m.text:='';
result:=m.count;
m.free;
end;