Program lib;
uses crt;
type Books=record
number:integer;
fio:string;
group:string;
home:string;
year:integer;
end;
var
book_file:file of books;
f:file of books;
data:array[1..20] of books;
rec:books;
file_name:string;
key,key1:integer;
exit:boolean;
x:string;
procedure name_of_file;
begin
write('Vvedite fail bazi dannih studentov:');
readln(file_name);
end;
procedure add_record;
begin
writeln('Record N',filepos(book_file)+1);
with rec do
begin
write('FIO:');
readln(fio);
write('Group:');
readln(group);
write('Vozrast:');
readln(year);
write('Address:');
readln(home);
write(book_file,rec);
end;
end;
procedure sort; //Не могу реализовать ввод из rec в массив Data а метод сортировки проверен работает
var i,n,j:integer;
begin
name_of_file;
assign(book_file,file_name);
{$I-}
reset(book_file);
{$I+}
if IOresult <> 0 then
writeln('File with name '+file_name+' is not')
else
begin
writeln;
while (not eof(book_file)) do
read(book_file,rec);
data[i]:=rec;
for i:=1 to n-1 do
for j:=1 to n-i do
if data[j].fio>data[j+1].fio then
begin
rec := data[j];
data[j] := data[j+1];
data[j+1] := rec;
end;
with rec do
begin
readln(fio);
readln(group);
readln(year);
readln(home);
end;
Массив записей, Не могу реализовать ввод из rec:books в массив Data of Books |