All pastes #519573 Raw Edit

Anonymous

public text v1 · immutable
#519573 ·published 2007-05-29 18:20 UTC
rendered paste body
function GetFolders(Path: string): TList;
 var
  SearchResult : TSearchRec;
  Temp: TList;
  dir: DGDir;
begin
  Result:=TList.Create;
  if FindFirst(Path+'\*.*', faDirectory, SearchResult) = 0 then
  begin
    repeat
     if (SearchResult.Name <> '.') and (SearchResult.Name <> '..') then
     begin
      dir:=DGDir.Create(Path+'\'+SearchResult.Name);
      Result.Add(dir);
     end;
    until FindNext(SearchResult) <> 0;
    FindClose(searchResult);
  end;
end;