I haven’t written in Pascal a long time ago, I have set a function and I cannot find an error.

`program _1; uses crt; var y:text; minSumEl,n,g:real; i,j,k:integer; f:array[1..6,1..7] of real; m:array[2..13] of real; function OpMiSuElDi(m:array[2..13] of real;i,j,k:integer;f:array[1..6,1..7] of real):real; for k:=2 to 13 do begin m[k]:=0; for i:=1 to 6 do begin for j:=1 to 7 do begin if i+j=k then m[k]:=m[k]+f[i,j]; end; end; if m[k]<result then result:=m[k]; end; begin clrscr; assign(y,'file.dat'); reset(y); g:=0; for i:=1 to 6 do begin for j:=1 to 7 do begin read(y,f[i,j]); write(f[i,j]:4:0); end; writeln; end; minSumEl:=OpMiSuElDi();; writeln('min summa elementov diagonali=',minSumEl:4:0); writeln(' '); for i:=1 to 6 do begin for j:=1 to 7 do begin n:=f[i,j]/3; if (g=0) and (f[i,j]<0) and (frac(n)=0) then begin g:=i; writeln('otrizatelny element kratny 3 v ',i,' stroke'); end; end; end; readkey; end.`