dim intProductID,strAction,arrCart,i
const MaxProducts = 20
const ProductID = 1
const Quantity = 2
intProductID = cint(request.querystring("ProductID"))
strAction = lcase(request.querystring("Action"))
arrCart = Session("ShoppingCart")
select case strAction
case "add"
AddProduct(intProductID)
case "remove"
RemoveProduct(intProductID)
end select
Function AddProduct(intProductID)
[b]if IsNull(arrCart(MaxProducts,ProductID)) then[/b]
for i = 1 to MaxProducts
if arrCart(i,ProductID) = "" then
arrCart(i,ProductID) = intProductID
arrCart(i,Quantity) = 1
exit for
elseif cint(arrCart(i,ProductID)) = intProductID then
arrCart(i,Quantity) = arrCart(i,Quantity) + 1
exit for
end if
next
session("ShoppingCart") = arrCart
response.redirect "visavarukorg.asp"
else
response.write "Din varukorg är full!"
end if
End Function
När jag kör koden får jag ett felmmeddelande på rad 25 som säger: "Type mismatch: 'arrCart'"
Har ni några förslag??
mvh André