TZF - OT Filelist

Ullrich Reuter <[email protected]> Sun, 2 Nov 2003 08:36:44 +0000
Newsgroups gmane.comp.lang.delphi.topaz
Message-ID <[email protected]>
Hi together,

I know, it's a little OffTopic, but there are a lot of clever people in 
here. So one might know the solution :-)

What I want to do is getting all the filenames in a dir listed in a 
TStringList. I use that code below. It works fine if there is any 
attribute set to the files but it doesn't if there is no attribute set. 
Why and how can I changed that? Any hints welcome.

THX

Ullrich


procedure Make_Filelist;
var
  sr: TSearchRec;
  FileAttrs: Integer;
begin
  Dateiliste := TStringList.Create;
    FileAttrs := faAnyFile;
    if FindFirst(DatenDir+'\*.'+MP_Extension, FileAttrs, sr) = 0 then
       begin
         with Dateiliste do
           begin
             if (sr.Attr and FileAttrs) = sr.Attr then
                Dateiliste.Add(DatenDir+'\'+sr.Name);
             while FindNext(sr) = 0 do
               begin
                 if (sr.Attr and FileAttrs) = sr.Attr then
                    Dateiliste.Add(DatenDir+'\'+sr.Name);
               end;
           end;
         FindClose(sr);
       end
    else
       TzDialogbox('Dateiliste','I','Empty list','');
end;

--^----------------------------------------------------------------
This email was sent to: [email protected]

EASY UNSUBSCRIBE click here: http://topica.com/u/?clvXPN.a5kvff.Z2NsZHQt
Or send an email to: [email protected]

TOPICA - Start your own email discussion group. FREE!
http://www.topica.com/partner/tag02/create/index2.html
--^----------------------------------------------------------------