צפיות
תשובות
בעיה בקוד
שלום רציתי לשאול מה הבעיה בקוד הבא שהמחשב אומר שבשורה
הבאה יש שגיאה
redim Preserve sCartItemNums(nThisItemIndex)
:הקוד המלא
<%
sCartItemNums = session("cartitemnumarray")
nCartItemQtys = session("cartitemqtyarray")
nNumCartItems = session (sCartItemNums)
'Determine the mode of this page's operation. If we got here from a
' link that had a "mode" querystring of "add", mode is add:
sMode = request.querystring("mode")
'Or, we could have gotten here from a form:
select case request.form("cmdSubmit")
case "Proceed to Checkout"
sMode = "checkout"
case "Recalculate Order"
sMode = "recalc"
case "Continue Shopping"
sMode = "continue"
end select
if sMode = "add" then
nThisItemIndex = 0
sItemNo = ucase(request.querystring("itemno"))
if nNumCartItems > 0 then
for i = 1 to nNumCartItems
if ucase(scartitemnums(i)) = sItemNo then
nThisItemIndex = i
exit for
end if
next
end if
if nThisItemIndex = 0 then
nThisItemIndex = nNumCartItems + 1
redim Preserve sCartItemNums(nThisItemIndex)
redim Preserve nCartItemQtys(nThisItemIndex)
sCartItemNums(nThisItemIndex) = sItemNo
nCartItemQtys(nThisItemIndex) = 1
else
nCartItemQtys(nThisItemIndex) = nCartItemQtys(nThisItemIndex) + 1
end if
session("cartitemnumarray") = sCartItemNums
session("cartitemqtyarray") = nCartItemQtys
nNumCartItems = ubound(sCartItemNums)
end if
if sMode = "recalc" or sMode = "checkout" or sMode = "continue" then
for i = 1 to nNumCartItems
nThisQty = int(request.form("txtItemQty" & i))
nCartItemQtys(i) = nThisQty
next
session("cartitemnumarray") = sCartItemNums
session("cartitemqtyarray") = nCartItemQtys
end if
'Move to another page based on mode.
' If mode is "add" or "recalc", we stay here.
' If mode is "continue", we move back to the main page so the user
' can shop more.
' If mode is "checkout", we stay here but change the mode th
select ca
1 תשובות
מה השגיאה?
לא מכיר vbs אבל מניח שאם תפרט את השגיאה מי שמכיר יוכל לנסות לעזור
אלי ענתבי
entry interactive
http://www.entry.co.il