
20.05.2009, 11:37
|
Прохожий
|
|
Регистрация: 17.04.2009
Сообщения: 23
Репутация: 10
|
|
Да я так и делаю, но он мне теперь ошибку не выдает, но и не складавает, в чем тут ошибка????
Код:
procedure TForm3.Button7Click(Sender: TObject);
var
i,z,k:integer;
w:real;
begin
a:=strtofloat(Form1.StringGrid1.Cells[1,5]);
b:=strtofloat(Form1.StringGrid1.Cells[1,6]);
begin
if Form3.StringGrid2.Cells[6,i]='' then
for i:=1 to 100 do
Form3.StringGrid2.Cells[6,i]:=FloatToStr(0)
end;
begin
if Form3.StringGrid3.Cells[3,i]='' then
for i:=1 to 100 do
Form3.StringGrid3.Cells[2,i]:=FloatToStr(0)
end;
begin
if Form3.StringGrid4.Cells[4,i]='' then
for i:=1 to 100 do
Form3.StringGrid4.Cells[4,i]:=FloatToStr(0)
end;
begin
if Form3.StringGrid5.Cells[5,i]='' then
for i:=1 to 100 do
Form3.StringGrid5.Cells[5,i]:=FloatToStr(0)
end;
for z := 0 to StringGrid6.RowCount - 1 do
StringGrid6.Rows[z].Clear();
Ln:=StrToFloat(Form1.Edit1.Text);
Lk:=StrToFloat(Form1.Edit3.Text);
Step:=StrToFloat(Form1.Edit5.Text);
L:=Ln;
i:=1;
k:=0;
While l<=Lk do
begin
w:=l/(3600*a*b);
Pobsie:=Pgeom+strtofloat(Form3.StringGrid1.Cells[4,i])+strtofloat(Form3.StringGrid2.Cells[6,i])+strtofloat(Form3.StringGrid3.Cells[2,i])+strtofloat(Form3.StringGrid4.Cells[4,i])+strtofloat(Form3.StringGrid5.Cells[5,i]);
Form3.StringGrid6.Cells[0,0]:='Ñêîðîñòü';
Form3.StringGrid6.Cells[1,0]:='Îáùèå ïîòåðè äàâëåíèÿ';
Form3.StringGrid6.Cells[0,i]:=FloatToStr(RoundTo(w,-2));
Form3.StringGrid6.Cells[1,i]:=FloatToStr(RoundTo(Pobsie,-2));
Form3.StringGrid6.Cells[2,i]:=FloatToStr(Pobsie);
i:=i+1;
L:=L+step;
k:=k+1;
end;
Form3.StringGrid6.RowCount:=k+1;
end;
|