这段代码背后的基本概念是,每当它运行时,来自一个元素的数量会减少,而来自同一元素但来自不同数组的数量会增加。无论出于何种原因,第二个 while 循环只运行一次并停止。例如,如果total1 = 11
和total2 = 0
,第一次执行代码时,total1 = 10
和total2 = 1
。然而在那之后,total1 = 9
等等total2 = 1
。谁能告诉我我的代码有什么问题?任何和所有的帮助将不胜感激。
<%
count = 0
do while NOT rs3.EOF
if rs3("ITEM_NO") = itemnum then
qtyArray(count) = qtyArray(count) - qtyreq
end if
if qtyArray(count) >= 0 and rs3("ITEM_NO") = itemnum then
total1 = total1 - qtyreq
end if
count = count + 1
rs3.MoveNext
loop
rs3.MoveFirst
pickcount = 0
do while NOT rs3.EOF
if qtyPick(pickcount) >= 0 and rs3("ITEM_NO") = itemnum then
qtyPick(pickcount) = qtyPick(pickcount) + qtyreq
total2 = total2 + qtyreq
end if
rs3.MoveNext
pickcount = pickcount + 1
loop
%>