ex43.pp 534 B

123456789101112131415161718192021222324252627
  1. Program Example43;
  2. { This program demonstrates the FindFirst function }
  3. Uses SysUtils;
  4. Var Info : TSearchRec;
  5. Count : Longint;
  6. Begin
  7. Count:=0;
  8. If FindFirst ('/*',faAnyFile and faDirectory,Info)=0 then
  9. begin
  10. Repeat
  11. Inc(Count);
  12. With Info do
  13. begin
  14. If (Attr and faDirectory) = faDirectory then
  15. Write('Dir : ');
  16. Writeln (Name:40,Size:15);
  17. end;
  18. Until FindNext(info)<>0;
  19. end;
  20. FindClose(Info);
  21. Writeln ('Finished search. Found ',Count,' matches');
  22. End.