ts010017.pp 634 B

123456789101112131415161718192021222324252627282930313233
  1. { show a problem with IOCHECK !!
  2. inside reset(file)
  3. we call reset(file,longint)
  4. but we also emit a call to iocheck after and this is wrong !! PM }
  5. program getret;
  6. uses dos;
  7. var
  8. ppfile : file;
  9. begin
  10. assign(ppfile,'this_file_probably_does_not_exist&~"#');
  11. {$I-}
  12. reset(ppfile,1);
  13. if ioresult=0 then
  14. begin
  15. {$I+}
  16. close(ppfile);
  17. end
  18. else
  19. writeln('the file does not exist') ;
  20. {$I-}
  21. reset(ppfile);
  22. if ioresult=0 then
  23. begin
  24. {$I+}
  25. close(ppfile);
  26. end
  27. else
  28. writeln('the file does not exist') ;
  29. end.