Ich bin mir nicht sicher ob ich dich richtig verstehe, aber versuch es mal so:
Delphi-Quellcode:
function FindFootballFiles(
const Path:
string): TStringDynArray;
var
FileFilter : TDirectory.TFilterPredicate;
begin
var sYear :
string := FormatDateTime('
YY', Now);
SearchPattern := Format('
?-Liga%s.fus', [sYear]);
FileFilter :=
function(
const Path:
String;
const SearchRec: TSearchRec): Boolean
begin
Result :=
Winapi.ShLwApi.PathMatchSpecW(PChar(SearchRec.
Name), PChar(SearchPattern));
end;
Result := TDirectory.GetFiles(Path, '
*.*', TSearchOption.soAllDirectories, FileFilter);
end;