hola, estoy tratando de seleccionar solo un tipo de archivos con findfirst pero no me funciona, este es el codigo, que hago mal?
Código:
procedure TForm3.FoldersData(Genero,Ruta:String);
var
R,ima : TSearchRec;
Busq,imagen, Dirs: Integer;
rimagen,mask : string;
noencontre : Boolean;
begin
WriteLn( F, Genero );
Dirs := 0;
noencontre := True;
Busq := FindFirst(Ruta + '*.*', FaAnyfile, R);
rimagen := '';
while Busq = 0 do
begin
if (R.Attr and faDirectory = faDirectory ) then
begin
if (R.Name <> '.') and (R.Name <> '..') then
begin
imagen := FindFirst(Ruta+R.Name+'\'+'*.*', FaAnyfile,ima);
while (imagen = 0)and noencontre=True do
begin
if ( ima.Attr and faArchive = faArchive ) and
( ima.Attr and faDirectory <> faDirectory ) then
begin
noencontre := False;
rimagen := Ruta+R.Name+'\'+ima.Name;
end;
imagen := FindNext(ima);
end;
FindClose(ima);
noencontre := True;
Inc(Dirs);
WriteLn( F,chr(9)+R.Name+'|'+Ruta+R.Name+'\|'+rimagen);
MusicaData(Genero,Ruta+R.Name+'\');
rimagen := '';
end;
end ;
Busq := FindNext(R);
end;