The procedure declares variables tD1 , tbetta , and does not initialize anything further, but the code works. The question is why does it work?

 Procedure MakeDO; var te,tD1,tbetta:real; t,ti:integer; begin AssignFile(FT_EXM,'REZ.TXT'); Rewrite(FT_EXM); if ifsaveclasses then begin for ti:=1 to n do Write(FT_EXM,VD[ti],' ',ND[ti],chr(9)); Writeln(FT_EXM); end; for k:=1 to m do begin if ifsaveclasses then begin AssignFile(FT,'REZ'+inttostr(k)+'.TXT'); Rewrite(FT); SaveClass(k); end; em[k]:=0; em_NWS[k]:=0; d[k]:=0; MakeSK(k); for t:=0 to n do begin te:=INFK(t,tD1,tbetta); if ifsaveclasses then Writeln(FT,t,chr(9),te:0:5,chr(9),td1:0:3,chr(9),tbetta:0:3,chr(9),1-td1:0:3,chr(9),1-tbetta:0:3,chr(9),round(td1*nr),chr(9),round((1-td1)*nr),chr(9),round((1-tbetta)*nr),chr(9),round(tbetta*nr)); if te>EM_NWS[k] then begin EM_NWS[k]:=te;d_NWS[k]:=t;d1_NWS[k]:=td1;b_NWS[k]:=tbetta; end; if (tD1>=0.5)and(tbetta<0.5)and(t<dc[k])then begin if te>em[k] then begin em[k]:=te;d[k]:=t;d1[k]:=td1;b[k]:=tbetta; end; end; end; if ifsaveclasses then begin Writeln(FT,'Class ',k,chr(9),'Em= ',em[k]:0:5,chr(9),'do= ',d[k],chr(9),'dc=',dc[k],chr(9),'D1= ',d1[k]:0:2,chr(9),'Betta= ',b[k]:0:2); Writeln('Class ',k,chr(9),'Em= ',em[k]:0:5,chr(9),'do= ',d[k],chr(9),'dc=',dc[k],chr(9),'D1= ',d1[k]:0:2,chr(9),'Betta= ',b[k]:0:2); Writeln(FT_EXM,k); for ti:=1 to n do Write(FT_EXM,EV[k,ti],' '); Writeln(FT_EXM); Writeln(FT_EXM,d[k]); closefile(FT); end; end; closefile(FT_EXM); end; 
  • five
    What does java have to do with it? Where is the specific question? - Andrew Bystrov
  • The INFK function probably looks like this: function INFK(t: integer, var tD1, tbetta: real): real; or out instead of var . The second and third parameters are passed as references, and their values ​​are assigned within the INFK . - Igor
  • @lgor function INFK (t_: integer; var t_D1: real; var t_betta: real): real; - Klaod
  • @AndrewBystrov the question is, what values ​​are passed to the function - Klaod
  • one
    So what about java and where? - Andrew Bystrov

1 answer 1

The INFK function probably looks like this:

 function INFK(t: integer, var tD1, tbetta: real): real; 

or out instead of var . The second and third parameters are passed as references, and their values ​​are assigned within the INFK . After the call

 te := INFK(t, tD1, tbetta); 

tD1 , tbetta have values ​​assigned within the INFK .