createlst.pp 587 B

1234567891011121314151617181920212223242526272829303132333435
  1. program createlst;
  2. uses
  3. SysUtils, Classes;
  4. var
  5. i: LongInt;
  6. sr: TSearchRec;
  7. path: String;
  8. sl: TStringList;
  9. begin
  10. if ParamCount = 0 then begin
  11. Writeln('createlst PATH [PATH [...]]');
  12. Exit;
  13. end;
  14. sl := TStringList.Create;
  15. for i := 1 to ParamCount do begin
  16. path := IncludeTrailingPathDelimiter(ParamStr(i));
  17. if FindFirst(path + 't*.pp', 0, sr) = 0 then begin
  18. repeat
  19. sl.Add(path + sr.Name);
  20. until FindNext(sr) <> 0;
  21. FindClose(sr);
  22. end;
  23. end;
  24. sl.Sort;
  25. for i := 0 to sl.Count - 1 do
  26. Writeln(sl[i]);
  27. sl.Free;
  28. end.