tables("a").sort = "成分名称"dim r0 as row = tables("a").rows(tables("a").rows.count - 1)
dim zl as integer = r0("所需重量")
dim sl as integer = r0("订单数量")
for i as integer = tables("a").rows.count - 2 to 0 step -1
dim r as row = tables("a").rows(i)
if r0("成分名称") = r("成分名称") then
zl = zl + r("所需重量")
sl = sl + r("订单数量")r.delete
else
r0("订单数量") = sl
r0("所需重量") = zlr0 = r
zl = r("所需重量")
sl = r("订单数量")
r0("订单数量") = sl
r0("
所需重量") = zl