Pascal

Moderators: None (Apply to moderate this forum)
Number of threads: 4106
Number of posts: 14016

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Re: how to update record in array in file? please check my existed Posted by Crono84 on 22 Feb 2012 at 4:31 PM
Well you first read the file recursive record by record witch tells me that the file is a file of type TStudent
and on the end You try to put the whole array by one time to it
try this
assign(StudentFile,'Student.dat');
rewrite(StudentFile);

i:=0;
repeat 
Write (StudentFile, Students[i]);
inc(i);
until i>NumStudents;
Closefile(StudentFile); 

or You can try this two
Write (StudentFile, Students);
{without the [i]}

and if needed the count of TStudent records to write
Write (StudentFile, Students,NumStudents);






 

Recent Jobs