Thema: Delphi Frage zu FindFirst

Einzelnen Beitrag anzeigen

kalmi01
(Gast)

n/a Beiträge
 
#3

Re: Frage zu FindFirst

  Alt 27. Dez 2005, 13:17
Hi,

Delphi-Quellcode:
    procedure DirShow (SearchDir, SearchFile : string;
                        var FileList : TStringList);
      var
        i : Integer;
        SearchRec : TSearchRec;
      begin
        if SearchDir[Length(SearchDir)] <> '\then SearchDir := SearchDir + '\';
        i := FindFirst(SearchDir + SearchFile, faDirectory, SearchRec);

        while i = 0
        do begin
             if (SearchRec.Name <> '.')
                and
                (SearchRec.Name <> '..')
             then begin
                    if FileExists(SearchDir + SearchRec.Name)
                    then FileList.Add(SearchDir + SearchRec.Name);
                  end;

             i := FindNext(SearchRec);
           end;
        FindClose(SearchRec);
      end;
  Mit Zitat antworten Zitat