I have the following procedures to load files that are in a directory into a listbox.
I believe the Parm faAnyFile determines what is loaded into the list box.
I would like to be able to load all files which is '*' or '*.*' and/or just sub directories in a directory.
It would be something like faDir but I haven't been able to make it work.
Or maybe I'm wrong and there is any such fa to do that.
procedure TForm1.DirToListbox(Const APath : String; Const aBox : TListbox);
VAR Info : TSearchRec;
begin
If FindFirst (aPath + '*',faAnyFile,Info)=0 then begin
repeat
with Info do begin
if (Attr and faAnyFile) <> 0 then // If we find a file
if Name = '.' then begin Continue; end;
if Name = '..' then begin Continue; end;
abox.Items.Add(Name)
end
until FindNext(info)<>0;
end;
FindClose(Info);
end;
Thanks
And the answer is 'faDirectory' DUH