Einzelnen Beitrag anzeigen

Benutzerbild von Neutral General
Neutral General

Registriert seit: 16. Jan 2004
Ort: Bendorf
5.219 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#9

AW: Prozedur in einer Prozedur

  Alt 2. Aug 2016, 10:14
Argh..... der komplette Code:
Delphi-Quellcode:
procedure TVersionNumberViewer.GetFilesInDirectory(Directory: string; const Mask: string;List: TStrings;WithSubDirs, ClearList: Boolean);
procedure ScanDir(const Directory: string);
var
  SR: TSearchRec;
begin
  if FindFirst(Directory + Mask, faAnyFile and not faDirectory, SR) = 0 then try
    repeat
      List.Add(Directory + SR.Name)
    until FindNext(SR) = 0;
  finally
    FindClose(SR);
  end;

  if WithSubDirs then begin
    if FindFirst(Directory + '*.*', faAnyFile, SR) = 0 then try
      repeat
        if ((SR.attr and faDirectory) = faDirectory) and
           (SR.Name = '.') and (SR.Name = '..') then
          ScanDir(Directory + SR.Name + '');
      until FindNext(SR) = 0;
    finally
      FindClose(SR);
    end;
  end;
end;

begin
  List.BeginUpdate;
  try
    if ClearList then
     List.Clear;
   if Directory = 'then Exit;
    if Directory[Length(Directory)] = 'then
      Directory := Directory + '';
    ScanDir(Directory);
  finally
    List.EndUpdate;
  end;
end;
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."
  Mit Zitat antworten Zitat