试试?
Loop("1>0","SetVariable(""%索引号%"",FindText(""备款单"",""用户索引号"",""B"", ""="" ,""0"")) And
FilterFor(""用户索引号"", ""="" ,[%索引号%],""B"",""="",""0"",""收与否"",""="",""0"") And
Report(""水费计算"",""水电费备款通知单1"",1,Rows,1) And
ReplaceFor(""备款单"",""B"", -1,""用户索引号"", ""="" ,[%索引号%]) And
DelFor(""备款单"",""B"", ""="" ,-1) And
SetVariable(""%索引号%"","""") And ShowAllRows()",20)