delphi Memo里的数据相加求和?
比如:
1
2
3
EDIT显示和数:6
var n,i:integer;
begin
for i := 0 to memo1.lines.count - 1 do
begin
n = n + StrToInt(memo1.lines[i]);
end;
edit1.Text = IntToStr(n);
end;
edit1.Text = IntToStr(n);
->
edit1.Text := IntToStr(n);
有小数点不行,会出错
另外你可以下载 http://download.csdn.net/album/detail/3779
前5个包,这光盘里面有delphi的入门教程,你先系统看下。