tw1081.pp 771 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. uses dos;
  2. var dirinfo:searchrec;
  3. function IntToStr(I: Longint): String;
  4. { Convert any integer type to a string }
  5. var
  6. S: string[11];
  7. begin
  8. Str(I, S);
  9. IntToStr := S;
  10. end;
  11. procedure write_error(errorstring:string);
  12. var
  13. h,m,s,j,mo,ta,dummy:word;
  14. stri:string;
  15. begin
  16. gettime(h,m,s,dummy);
  17. getdate(j,mo,ta,dummy);
  18. stri:=inttostr(j)+':'+inttostr(mo)+':'+inttostr(ta)+' '+inttostr(h)+':'+inttostr(m)+':'+inttostr(s);
  19. writeln(stri,' ',errorstring);
  20. end;
  21. procedure readprgfiles;
  22. var i:word;
  23. begin
  24. FindFirst('*.pp',anyfile, DirInfo);
  25. while doserror = 0 do
  26. begin
  27. inc(i);
  28. writeln(dirinfo.name);
  29. write_error(dirinfo.name); {without this function the program works}
  30. FindNext(DirInfo);
  31. end;
  32. write_error('fertig');
  33. end;
  34. BEGIN
  35. readprgfiles;
  36. END.