procedure ReadFromTxt(var Matr: TMatr);
const
Direction = 'C:\File.dat;
var
FileCh: Text;
i, j: Byte;
begin
Assign(FileCh, Direction);
Reset(FileCh);
for i:=1 to Max_Value do
for j:=1 to Max_Value do
read(FileCh, Matr[i, j]);
Close(FileCh);
end;
Нужно чтобы программа сама создавала файл, генерировала значения, и записывала их в него.
наброски есть, но почему то вылазиет ошибка. помогите пожалуйста
procedure ReadFromTxt(var Matr: TMatr);
const
Direction = 'W:\File.dat';
var
i, j: Byte;
a,a1:integer;
begin
randomize;
Assign(FileCh, 'С:\File.dat');
rewrite(FileCh);
for i:=1 to sqr(Max_Value) do begin
a:=random(65535)-32767;
write (FileCh,a);
end;
close(FileCh);
reset(FileCh);
for i:=1 to Max_Value do
for j:=1 to Max_Value do begin
read(FileCh,a1);
Matr[i, j]:=a1; end;
Close(FileCh);
end;