I'm working on a porgram for the school works. I wrote the procedure below to save the array of records(directory) into the file. But the procedure won't work when there is a record in the file.It's urgent. Thanks for your help.
procedure saving(input : array of directory);
var
i : integer;
textFile : file of directory;
begin
assign(textFile , 'data.dat');
rewrite(textFile);
for i:= 1 to 2500 do
write(textFile, input[i]);
close(textFile);
end;