home *** CD-ROM | disk | FTP | other *** search
- { EXTEST.PAS }
- {
- Description: Program to test for the existence of a file, using the
- Boolean function "Exists". (This version uses the version
- of Exists nearly identical to the one in the Turbo Pascal
- Reference Manual for versions 1.0 through 3.0.)
-
- Author: Don Taylor
- Date: 2/3/88
- Last revised: 02/03/88 16:25
- Application: Turbo Pascal (all versions through 4.0)
- }
-
-
- PROGRAM TestExist;
-
- TYPE
- Str80 = STRING[80];
-
- VAR
- Fil : FILE;
-
- CONST
- FileName = 'EXTEST';
-
- {$I EXISTS.INC }
-
- {====================}
-
- BEGIN { TestExist }
- ASSIGN(Fil, FileName);
- IF Exists(FileName)
- THEN WRITELN('File exists.')
- ELSE BEGIN
- REWRITE(Fil);
- CLOSE(Fil)
- END;
- END. { TestExist }