注册 登录
编程论坛 Delphi论坛

求解一个delphi循环显示数据的程序

yuutian 发布于 2010-11-03 13:27, 816 次点击
procedure TForm1.Button3Click(Sender: TObject);
var
   coef0,coef1:double;
   j:integer;
begin
for j:=1  to  stringgrid2.RowCount-1 do
begin
     coef0:=strtofloat(stringgrid2.Cells[2,j]);
     coef1:=strtofloat(stringgrid2.Cells[3,j]);
     memo1.text:=floattostr(coef0-coef1);
end;
end;
end.
程序编译时没有错误,运行时也没有错误,只是运行后,只显示一个结果,其他的不显示。
       哪位高手能帮忙指导一下
2 回复
#2
yeye552010-11-03 18:50
procedure TForm1.Button3Click(Sender: TObject);
var
   coef0,coef1:double;
   j:integer;
begin
for j:=1  to  stringgrid2.RowCount-1 do
begin
     coef0:=strtofloat(stringgrid2.Cells[2,j]);
     coef1:=strtofloat(stringgrid2.Cells[3,j]);
     memo1.Lines.Add(floattostr(coef0-coef1));
end;
end;
end.
#3
yuutian2010-11-03 20:57
非常感谢高手帮忙
1