Додаток 3.

unit UModel;

...............................

procedure TFModel.FormClose(Sender: TObject; var Action: TCloseAction);

begin

 action:=CaFree;

end;

 

procedure TFModel.FormActivate(Sender: TObject);

begin

 tabl.Cells[0,0]:='Номер';

 tabl.Cells[1,0]:='Х істинне';

 tabl.Cells[2,0]:='Y істинне';

 tabl.Cells[3,0]:='Істинні похибки';

 tabl.Cells[4,0]:='Х спотворене';

 tabl.Cells[0,1]:='1';

 tabl.Cells[0,2]:='2';

 tabl.Cells[0,3]:='3';

 tabl.Cells[0,4]:='4';

 tabl.Cells[0,5]:='5';

 tabl.Cells[0,6]:='6';

 tabl.Cells[0,7]:='7';

 tabl.Cells[0,8]:='8';

 tabl.Cells[0,9]:='9';

 tabl.Cells[0,10]:='10';

 tabl.Cells[0,11]:='11';

 tabl.Cells[0,12]:='12';

 tabl.Cells[0,13]:='13';

 tabl.Cells[0,14]:='14';

 tabl.Cells[0,15]:='15';

 tabl.Cells[0,16]:='16';

 tabl.Cells[0,17]:='17';

 tabl.Cells[0,18]:='18';

 tabl.Cells[0,19]:='19';

 tabl.Cells[0,20]:='20';

 tabl.Cells[0,21]:='21';

 tabl.Cells[0,22]:='22';

 tabl.Cells[0,23]:='23';

 tabl.Cells[0,24]:='24';

 tabl.Cells[0,25]:='25';

 tabl.Cells[0,26]:='26';

 tabl.Cells[0,27]:='27';

 tabl.Cells[0,28]:='28';

 tabl.Cells[0,29]:='29';

 tabl.Cells[0,30]:='30';

 tabl.Cells[0,31]:='31';

 tabl.Cells[0,32]:='32';

 tabl.Cells[0,33]:='33';

 tabl.Cells[0,34]:='34';

 tabl.Cells[0,35]:='35';

 tabl.Cells[0,36]:='36';

 tabl.Cells[0,37]:='37';

 tabl.Cells[0,38]:='38';

 tabl.Cells[0,11]:='Сума';

end;

procedure TFModel.BitBtn3Click(Sender: TObject);

 

var

 a:array [1..39] of real;

 summ:real;

 sr:real;

 i:integer;

 f:TextFile;

 xspotv:string[39];

begin

 tabl.Cols[1].LoadFromFile('date\Xist.txt');

 tabl.Cols[2].LoadFromFile('date\Yist.txt');

 tabl.Cols[3].LoadFromFile('date\istPohib.txt');

 

tabl.Cells[4,1]:=floattostr((strtofloat(tabl.Cells[1,1]))+(strtofloat(tabl.Cells[3,1])));//,ffGeneral,6,5);

  tabl.Cells[4,2]:=floattostr((strtofloat(tabl.Cells[1,2]))+(strtofloat(tabl.Cells[3,2])));//,ffGeneral,6,5);

  tabl.Cells[4,3]:=floattostr((strtofloat(tabl.Cells[1,3]))+(strtofloat(tabl.Cells[3,3])));//,ffGeneral,6,5);

  tabl.Cells[4,4]:=floattostr((strtofloat(tabl.Cells[1,4]))+(strtofloat(tabl.Cells[3,4])));//,ffGeneral,6,5);

  tabl.Cells[4,5]:=floattostr((strtofloat(tabl.Cells[1,5]))+(strtofloat(tabl.Cells[3,5])));//,ffGeneral,6,5);

  tabl.Cells[4,6]:=floattostr((strtofloat(tabl.Cells[1,6]))+(strtofloat(tabl.Cells[3,6])));//,ffGeneral,6,5);

  tabl.Cells[4,7]:=floattostr((strtofloat(tabl.Cells[1,7]))+(strtofloat(tabl.Cells[3,7])));//,ffGeneral,6,5);

  tabl.Cells[4,8]:=floattostr((strtofloat(tabl.Cells[1,8]))+(strtofloat(tabl.Cells[3,8])));//,ffGeneral,6,5);

  tabl.Cells[4,9]:=floattostr((strtofloat(tabl.Cells[1,9]))+(strtofloat(tabl.Cells[3,9])));//,ffGeneral,6,5);

  tabl.Cells[4,10]:=floattostr((strtofloat(tabl.Cells[1,10]))+(strtofloat(tabl.Cells[3,10])));//,ffGeneral,6,5);

  tabl.Cells[4,11]:=floattostr((strtofloat(tabl.Cells[1,11]))+(strtofloat(tabl.Cells[3,11])));//,ffGeneral,6,5);

  tabl.Cells[4,12]:=floattostr((strtofloat(tabl.Cells[1,12]))+(strtofloat(tabl.Cells[3,12])));//,ffGeneral,6,5);

  tabl.Cells[4,13]:=floattostr((strtofloat(tabl.Cells[1,13]))+(strtofloat(tabl.Cells[3,13])));//,ffGeneral,6,5);

  tabl.Cells[4,14]:=floattostr((strtofloat(tabl.Cells[1,14]))+(strtofloat(tabl.Cells[3,14])));//,ffGeneral,6,5);

  tabl.Cells[4,15]:=floattostr((strtofloat(tabl.Cells[1,15]))+(strtofloat(tabl.Cells[3,15])));//,ffGeneral,6,5);

  tabl.Cells[4,16]:=floattostr((strtofloat(tabl.Cells[1,16]))+(strtofloat(tabl.Cells[3,16])));//,ffGeneral,6,5);

  tabl.Cells[4,17]:=floattostr((strtofloat(tabl.Cells[1,17]))+(strtofloat(tabl.Cells[3,17])));//,ffGeneral,6,5);

  tabl.Cells[4,18]:=floattostr((strtofloat(tabl.Cells[1,18]))+(strtofloat(tabl.Cells[3,18])));//,ffGeneral,6,5);

  tabl.Cells[4,19]:=floattostr((strtofloat(tabl.Cells[1,19]))+(strtofloat(tabl.Cells[3,19])));//,ffGeneral,6,5);

  tabl.Cells[4,20]:=floattostr((strtofloat(tabl.Cells[1,20]))+(strtofloat(tabl.Cells[3,20])));//,ffGeneral,6,5);

  tabl.Cells[4,21]:=floattostr((strtofloat(tabl.Cells[1,21]))+(strtofloat(tabl.Cells[3,21])));//,ffGeneral,6,5);

  tabl.Cells[4,22]:=floattostr((strtofloat(tabl.Cells[1,22]))+(strtofloat(tabl.Cells[3,22])));//,ffGeneral,6,5);

  tabl.Cells[4,23]:=floattostr((strtofloat(tabl.Cells[1,23]))+(strtofloat(tabl.Cells[3,23])));//,ffGeneral,6,5);

  tabl.Cells[4,24]:=floattostr((strtofloat(tabl.Cells[1,24]))+(strtofloat(tabl.Cells[3,24])));//,ffGeneral,6,5);

  tabl.Cells[4,25]:=floattostr((strtofloat(tabl.Cells[1,25]))+(strtofloat(tabl.Cells[3,25])));//,ffGeneral,6,5);

  tabl.Cells[4,26]:=floattostr((strtofloat(tabl.Cells[1,26]))+(strtofloat(tabl.Cells[3,26])));//,ffGeneral,6,5);

  tabl.Cells[4,27]:=floattostr((strtofloat(tabl.Cells[1,27]))+(strtofloat(tabl.Cells[3,27])));//,ffGeneral,6,5);

  tabl.Cells[4,28]:=floattostr((strtofloat(tabl.Cells[1,28]))+(strtofloat(tabl.Cells[3,28])));//,ffGeneral,6,5);

  tabl.Cells[4,29]:=floattostr((strtofloat(tabl.Cells[1,29]))+(strtofloat(tabl.Cells[3,29])));//,ffGeneral,6,5);

  tabl.Cells[4,30]:=floattostr((strtofloat(tabl.Cells[1,30]))+(strtofloat(tabl.Cells[3,30])));//,ffGeneral,6,5);

  tabl.Cells[4,31]:=floattostr((strtofloat(tabl.Cells[1,31]))+(strtofloat(tabl.Cells[3,31])));//,ffGeneral,6,5);

  tabl.Cells[4,32]:=floattostr((strtofloat(tabl.Cells[1,32]))+(strtofloat(tabl.Cells[3,32])));//,ffGeneral,6,5);

  tabl.Cells[4,33]:=floattostr((strtofloat(tabl.Cells[1,33]))+(strtofloat(tabl.Cells[3,33])));//,ffGeneral,6,5);

  tabl.Cells[4,34]:=floattostr((strtofloat(tabl.Cells[1,34]))+(strtofloat(tabl.Cells[3,34])));//,ffGeneral,6,5);

  tabl.Cells[4,35]:=floattostr((strtofloat(tabl.Cells[1,35]))+(strtofloat(tabl.Cells[3,35])));//,ffGeneral,6,5);

  tabl.Cells[4,36]:=floattostr((strtofloat(tabl.Cells[1,36]))+(strtofloat(tabl.Cells[3,36])));//,ffGeneral,6,5);

  tabl.Cells[4,37]:=floattostr((strtofloat(tabl.Cells[1,37]))+(strtofloat(tabl.Cells[3,37])));//,ffGeneral,6,5);

  tabl.Cells[4,38]:=floattostr((strtofloat(tabl.Cells[1,38]))+(strtofloat(tabl.Cells[3,38])));//,ffGeneral,6,5);

 

     for i:=1 to 38 do

      if tabl.Cells[4,i]<>''

       then

      a[i]:=StrToFloat(tabl.Cells[4,i])

       else a[i]:=0;

       summ:=0;

        for i:=1 to 38 do

        summ:=summ+a[i];

    tabl.Cells[4,39]:=FloatToStr(summ);//,ffGeneral,6,5);

    for i:=1 to 39 do

     if tabl.Cells[1,i]<>''

      then

     a[i]:=StrToFloat(tabl.Cells[1,i])

       else a[i]:=0;

       summ:=0;

       for i:=1 to 10 do

       summ:=summ+a[i];

    tabl.Cells[1,39]:=FloatToStr(summ);//,ffGeneral,6,5);

     for i:=1 to 38 do

      if tabl.Cells[2,i]<>''

       then

      a[i]:=StrToFloat(tabl.Cells[2,i])

        else a[i]:=0;

        summ:=0;

        for i:=1 to 38 do

        summ:=summ+a[i];

   tabl.Cells[2,39]:=FloatToStr(summ);//,ffGeneral,6,5);

           begin

                xspotv:=tabl.Cells[4,i];

                AssignFile(f,'date\Xspotv.txt');

                Rewrite(f);

               for i:=0 to 40 do

                writeln(f,tabl.Cells[4,i]);

                CloseFile(f);

           end;

end;

 

end.