设1数值型变量:%zsl%
ClearSubtotal() And DelFor(Grid,"料号","=","") And DelFor(Grid,"料号","instr","小计") And DelFor(Grid,"料号","=","总计") And Eval("SetVariable(""%zsl%"","+text(sumfor(Grid,"数量"))+")")And CreateGrid(".","料号",0,"数量",1,"Y",3) And Cleargrid(grids) and CopyRows(grids) And DelRow(grids,1) And Do(220,1) and EvalFor(grid,"料号","IF(if(FindRow(Grids,""料号"",""="",[料号],2)=0,ReplaceFor(Grids,""Y"",-1,""料号"",""="",[料号]),True),[料号],[料号])",0,0,1) And DelFor(grids,"Y","=",-1) And EvalFor(grids,3,"SubtotalFill(Grids,""料号"",""数量"",2)",1,1) And EvalFor(grids,1,"[料号]+""小计""","料号", "<>" ,"总计") And Do(112) and AppendRows(grids) And RemoveGrid(grids)And SetCellText(Grid,Rows,"数量",[%zsl%]) And SortCol(Grid,"料号",1)And EvalFor(Grid,"料号","""小计 ""+Substitute([料号],""小计"","""")","料号", "instr" ,"小计") And MarkRowFor(12910591,0,"料号", "instr" ,"小计")And MarkRowFor(8453888,0,"料号","=","总计")