blob: 578976f2c56e6f483558038f1b38c7cf5e598c73 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
PROGRAM Test;
USES
SysUtils;
procedure do_error(l : longint);
begin
writeln('Error near number ',l);
halt(1);
end;
VAR
dateTime: TDateTime;
f : file;
BEGIN
if FileExists('datetest.dat') then
begin
Assign(f,'datetest.dat');
Erase(f);
end;
if FileExists('datetest.dat') then
do_error(1000);
FileClose(FileCreate('datetest.dat'));
if not(FileExists('datetest.dat')) then
do_error(1001);
dateTime := IncMonth(Now, -1);
if FileSetDate('datetest.dat', DateTimeToFileDate(dateTime))<>0 then
do_error(1002);
if FileExists('datetest.dat') then
begin
Assign(f,'datetest.dat');
Erase(f);
end;
END.
|