home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / files / fileman / filestuf / extest.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1988-09-09  |  784 b   |  39 lines

  1. { EXTEST.PAS }
  2. {
  3. Description:  Program to test for the existence of a file, using the
  4.               Boolean function "Exists". (This version uses the version
  5.               of Exists nearly identical to the one in the Turbo Pascal
  6.               Reference Manual for versions 1.0 through 3.0.)
  7.  
  8. Author:       Don Taylor
  9. Date:         2/3/88
  10. Last revised: 02/03/88  16:25
  11. Application:  Turbo Pascal (all versions through 4.0)
  12. }
  13.  
  14.  
  15. PROGRAM TestExist;
  16.  
  17. TYPE
  18.  Str80 = STRING[80];
  19.  
  20. VAR
  21.  Fil : FILE;
  22.  
  23. CONST
  24.  FileName = 'EXTEST';
  25.  
  26. {$I EXISTS.INC }
  27.  
  28. {====================}
  29.  
  30. BEGIN { TestExist }
  31.  ASSIGN(Fil, FileName);
  32.  IF Exists(FileName)
  33.   THEN WRITELN('File exists.')
  34.   ELSE BEGIN
  35.         REWRITE(Fil);
  36.         CLOSE(Fil)
  37.        END;
  38. END.  { TestExist }
  39.