Fórum funçao que verifica qntos arquivos tem em uma pasta.... #227878
26/04/2004
0
ex: na pasta tem
teste_1.jpg
teste_2.jpg
teste_3.mp3
ele retorna 3 .. referente a quantidade de arquivos q começa com teste_
valeuz! :)
Salsa
Curtir tópico
+ 0Posts
26/04/2004
Rômulo Barros
Gostei + 0
27/04/2004
Salsa
ninguem ae tem essa funçao?
Gostei + 0
27/04/2004
Fabio.hc
function ContaArquivo(Pasta, Nome:string):integer; var Rec : TSearchRec; Procura, Contador:integer; begin Contador:=0; procura:=SysUtils.FindFirst(Pasta+Nome,faAnyFile, Rec); Contador:=0; while procura = 0 do begin inc(Contador); procura:=SysUtils.FindNext(Rec) end; SysUtils.FindClose(Rec); Result:=Contador; end;
e para chamar:
procedure TForm1.Button1Click(Sender: TObject); begin Edit1.Text:=IntToStr(ContaArquivo(´C:\´,´teste*´)); end;
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)