Moin!
Just ignore this message, after reading your reply it stroke me

that this actually works, but I only added
'texture' as a search reference, hence I always ended up with 1 match, but since my folders are named "texture", "texture.1", "texture.2". I had to change the dirmask to
'texture*.*' now this is working.
Full code below.
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16:
| procedure GetSubDirectories(const directory, Dirmask : string; list : TStrings) ; var sr : TSearchRec; begin try if FindFirst(IncludeTrailingPathDelimiter(directory) + (Dirmask), faDirectory, sr) < 0 then Exit else repeat if ((sr.Attr and faDirectory <> 0) AND (sr.Name <> '.') AND (sr.Name <> '..')) then List.Add(IncludeTrailingPathDelimiter(directory) + sr.Name) ; until FindNext(sr) <> 0; finally SysUtils.FindClose(sr) ; end; end; |
Use following to use the getsubdirectories.
Delphi-Quelltext
1:
| GetSubDirectories(sAcFolder, 'Texture*.*', sl) ; |
Regards,
Johan
Moderiert von
Narses: Überflüssige Zeilenumbrüche/Leerzeilen entfernt.