Разработка инвестиционного проекта ОАО "Завод по производству труб большого диаметра"

Дипломная работа - Экономика

Другие дипломы по предмету Экономика

j:=j+2;

end;

for j:=1 to 500 do begin

For kvar:=1 to ndvar do begin

if kvar <>4 then Svar[j,i]:=Svar[j,i]+Dvar[kvar,i];

end;

end;

end;

For i:=1 to StringGrid1.Colcount-3 do begin

For j:=1 to 500 do begin

StringGrid3.Cells[i,j]:=FloatToStr(Svar[j,i]);

Simd[i]:=Simd[i]+Svar[j,i];

end;

Simd[i]:=Simd[i]/500;

Form8.StringGrid3.Cells[i-1,1]:=FloatToStrF(Simd[i],ffFixed,9,2);

end;

 

For i:=1 to StringGrid1.ColCount-3 do begin

For j:=i to StringGrid1.ColCount-3 do begin

For kvar:=1 to 500 do begin

Covar[i,j]:=Covar[i,j]+((Svar[kvar,i]-Simd[i])*(Svar[kvar,j]-Simd[j]));

end;

Covar[i,j]:=Covar[i,j]/500;

Form3.StringGrid1.Cells[j,i]:=FloatToStrF(Covar[i,j],ffFixed,12,2);

Form3.StringGrid1.Cells[i,j]:=FloatToStrF(Covar[i,j],ffFixed,12,2);

end;

end;

end;

 

procedure TForm7.StringGrid1Exit(Sender: TObject);

begin

Try

For j:=3 to StringGrid1.ColCount-1 do begin

i:=1;

While i<=StringGrid1.RowCount-1 do begin

Xvar[i,j-2]:=StrToFloat(StringGrid1.Cells[j,i]);

Xvar[i,j-2]:=(Xvar[i,j-2]+StrToFloat(StringGrid1.Cells[j,i+1]))/2;

Xvar[i+1,j-2]:=Xvar[i,j-2]-StrToFloat(StringGrid1.Cells[j,i]);

i:=i+2;

end;

end;

except

ShowMessage('Неправельный ввод данных!');

FocusControl(StringGrid1);

end;

end;

 

procedure TForm7.StringGrid2Exit(Sender: TObject);

var

nn1 : real;

begin

Try

For j:=2 to StringGrid2.ColCount-1 do begin

For i:=1 to StringGrid2.RowCount-1 do begin

Dvar[i,j-1]:=StrToFloat(StringGrid2.Cells[j,i]);

If StringGrid2.Cells[0,i]='-' then Dvar[i,j-1]:=-Dvar[i,j-1]

end;

end;

Except

ShowMessage('Неправельный ввод данных!');

FocusControl(StringGrid2);

end;

ndvar:=StringGrid2.RowCount-1;

end;

 

procedure TForm7.N3Click(Sender: TObject);

Var

Myfile : Textfile;

Date : String;

begin

If (saveDialog1.Execute) then begin

AssignFile(Myfile,Savedialog1.FileName);

Try Rewrite(myFile);

Except

Showmessage('Ошибка при чтении файла!'); Exit;

end;

Date:=IntToStr(StringGrid1.ColCount);WriteLn(MyFile,Date);

Date:=IntToStr(StringGrid1.RowCount);WriteLn(MyFile,Date);

Date:=IntToStr(StringGrid2.ColCount);WriteLn(MyFile,Date);

Date:=IntToStr(StringGrid2.RowCount);WriteLn(MyFile,Date);

For i:=0 to StringGrid1.ColCount do begin

for j:=0 to StringGrid1.RowCount do begin

Date:=StringGrid1.Cells[i,j];

WriteLn(Myfile,Date);

end;

end;

For i:=0 to StringGrid2.ColCount do begin

For j:=0 to StringGrid2.RowCount do begin

Date:=StringGrid2.Cells[i,j];

WriteLn(Myfile,Date);

end;

end;

Closefile(myFile);

end

else Begin Showmessage('Ошибка!'); Exit;end;

end;

end.