从表中删除特定行

时间:2015-02-01 13:43:16

标签: eclipse egl

我正在研究本教程的示例: http://www-01.ibm.com/support/knowledgecenter/SSMQ79_9.1.1/com.ibm.egl.richui.sql.tutorial.doc/topics/egl_richui_sql_intro.html

我想稍微更改一下。我添加了另一个dojo按钮,当我点击它时,我想删除金额为0且属性相同的连续行。到目前为止,我的代码只删除了第一个元素。

以下是我的代码和帮助您的示例数据。

enter image description here

 for(i int from 1 to allPayments.getSize())
        if(allPayments[i].amount == 0)
            allPayments.removeElement(i);
            if((i+1)<=allPayments.getSize())

                if((allPayments[i+1].amount == 0)&&(allPayments[i].category==allPayments[i+1].category))
                    allPayments.removeElement(i+1);
                 end
            end
            //exit for;
        end
    end

1 个答案:

答案 0 :(得分:0)

我可以问你数组中的第一个元素是否从0开始? 如果是这种情况,看起来像是在递增数组,因此数组[0]不属于您的条件。