帮写个函数调用IY 可能等于1 - NNNN
listbox2.Items[N]行 每行都是数字
if iy=0 then ww:=0;
if iy=1 then ww:=StrToInt(listbox2.Items[0]);
if iy=2 then ww:=StrToInt(listbox2.Items[0])+StrToInt(listbox2.Items[1]);
if iy=3 then ww:=StrToInt(listbox2.Items[0])+StrToInt(listbox2.Items[1])+StrToInt(listbox2.Items[2]);
if iy=4 then ww:=StrToInt(listbox2.Items[0])+StrToInt(listbox2.Items[1])+StrToInt(listbox2.Items[2])+StrToInt(listbox2.Items[3]);
if iy=5 then ww:=StrToInt(listbox2.Items[0])+StrToInt(listbox2.Items[1])+StrToInt(listbox2.Items[2])+StrToInt(listbox2.Items[3])+StrToInt(listbox2.Items[4]);
if iy=6 then ww:=StrToInt(listbox2.Items[0])+StrToInt(listbox2.Items[1])+StrToInt(listbox2.Items[2])+StrToInt(listbox2.Items[3])+StrToInt(listbox2.Items[4])+StrToInt(listbox2.Items[5]);
if iy=7 then ww:=StrToInt(listbox2.Items[0])+StrToInt(listbox2.Items[1])+StrToInt(listbox2.Items[2])+StrToInt(listbox2.Items[3])+StrToInt(listbox2.Items[4])+StrToInt(listbox2.Items[5])+StrToInt(listbox2.Items[6]);
begin
Result := 0;
for i := 0 to iy - 1 do
begin
Result := Result + strtoint(listbox2.items[i]);
end;
end;
begin
if iy = 0 then
Result := 0
else
Result := StrToInt(ListBox2.Items[iy-1]) + CalcSum2(iy-1);
end;