home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / files / fileman / filestuf / exists.inc < prev    next >
Encoding:
Text File  |  1988-09-09  |  529 b   |  25 lines

  1. { EXISTS.INC }
  2. {
  3. Description:  Function to test for the existence of a specified file. (This
  4.               version virtually identical to the "Exist" function printed
  5.               in the Turbo Pascal Reference Manual for Versions 1.0 - 3.0.)
  6.  
  7. Author:       "Frank Borland"
  8. Application:  Turbo Pascal (all versions through 4.0)
  9. }
  10.  
  11.  
  12. FUNCTION Exists( FName : Str80) : BOOLEAN;
  13.  
  14. VAR
  15.  f : FILE;
  16.  
  17. BEGIN { Exists }
  18.  ASSIGN(f, FName);
  19.  {$I-}
  20.  RESET(f);
  21.  CLOSE(f);
  22.  {$I+}
  23.  Exists := IOResult = 0
  24. END; { Exists }
  25.