Hi All,<BR><BR>Please help me, I&#039ve been trying to figure this out for almost a week. I&#039ve searched countless asp sites trying to find an answer.<BR><BR>I am going nuts trying to figure out how to use session level arrays in this code. I need to add elements to 2 session level arrays and retrieve them on the same page. This is going to be part of a shopping cart (my first one). The array.asp include file initializes the local arrays. The subs.asp file just stores my subroutines. To see the contents of both files, scroll way down...<BR><BR>I Took out the actual DB stuff to save space(no problems there). <BR><BR>&#060;HTML&#062;<BR>&#060;BODY bgcolor=lightblue&#062;<BR>&#060;!--#INCLUDE VIRTUAL="/nkatom/includes/subs.asp"--&#062; <BR>&#060;!--#INCLUDE VIRTUAL="/nkatom/includes/array.asp"--&#062;<BR><BR>&#060;center&#062;&#060;a href= "sctest.asp"&#062;sctest.asp&#060;/a&#062;<BR>&#060;/center&#062;<BR><BR>&#060;% <BR><BR>&#039ADD ITEMS TO CART ARRAYS AND DISPLAY <BR>&#039CONFIRMATION MESSAGE<BR>for each txt in request.querystring <BR> pNum = "": Qty = ""<BR> If txt &#060;&#062; "button" then pnum = Mid(txt,4)<BR> Qty = Request.QueryString(txt)<BR> if Qty &#060;&#062; "" and pnum &#060;&#062; "" then<BR> response.write "You wish to Order a Quantity of " & Qty & _<BR> " product number " & pnum & "&#039s<BR>"<BR> itCount=itCount+1<BR> session("itemcount")=itCount<BR> call resize (pNumArr,qtyArr)<BR> &#039THE NEXT LINE IS WHERE I GET A TYPE MISMATCH ERROR,<BR> <BR> pNumArr=Session("pNumArr")<BR> qtyArr=Session("qtyArr")<BR> &#039SO I TRIED THIS: <BR> &#039 pNumArr()=Session("pNumArr")<BR> &#039 qtyArr()=Session("qtyArr")<BR> <BR> &#039THAT GIVES THIS ERROR:<BR> &#039 Microsoft VBScript runtime error &#039 800a0009&#039 <BR><BR> &#039 Subscript out of range <BR> &#039WHY?????????????????????????????????????????< BR> &#039MY RESIZE FUNCTION SEEMS TO WORK WHEN I EMPTY THE CART <BR> &#039OR ADD AN ITEM. <BR> <BR> pNumArr(itCount)=pNum<BR> qtyArr(itCount)=qty<BR> session("pNumArr")=pNumArr<BR> session("qtyArr")=qtyArr<BR> end if<BR>next<BR><BR>if Request.QueryString("cmd")=1 then<BR> call emptycart(pNumArr,qtyArr)<BR>end if<BR><BR>Response.Write "Session ubound is " & ubound(session("pNumArr"))<BR>Response.Write "<BR>Local ubound is " & ubound(pNumArr)<BR><BR>%&#062;<BR><BR><BR><BR>&#06 0;CENTER&#062;&#060;B&#062;Type in a quantity to order and click the "Add To Cart" button.&#060;/B&#062;<BR>&#060;/CENTER&#062;<BR>&#060;FORM NAME="test" ACTION="sctest.asp" METHOD="GET"&#062;<BR><BR>&#060;%<BR>Response.Writ e (session("itemCount"))& " in your cart<BR>"<BR>for i= 0 to itCount<BR> Response.Write i & "&nbsp&nbspProduct Number =&nbsp" & _<BR> pNumArr(i) & "&nbsp&nbsp&nbspQuantity =&nbsp" & _<BR> qtyArr(i) & "<BR>"<BR>next<BR>%&#062;<BR><BR><BR> &#060;CENTER&#062;&#060;a href="sctest.asp?cmd=1"&#062;empty cart&#060;/a&#062;<BR> &#060;a href="viewcart.asp"&#062;View Cart&#060;/a&#062;&#060;p&#062;&#060;/p&#062;<BR><BR> &#060;INPUT TYPE="Reset" VALUE="Reset"&#062;<BR> &#060;/CENTER&#062;<BR>&#060;/FORM&#062;<BR><BR><BR><BR><BR>&#060;/BODY&#062;<BR>&#060;/HTML&#062;<BR> <BR>&#039***********Begin Include Files***************<BR>&#039***********array.asp* ************************<BR>&#060;%<BR>&#039INITAL IZE LOCAL PRODUCT NUMBER AND QUANTITY ARRAYS<BR>dim pNumArr()<BR>dim qtyArr()<BR>dim itCount<BR><BR>&#039SIZE ARRAYS ACCORDING TO ITEM COUNT<BR>call resize (pNumArr,qtyArr)<BR><BR>itCount=session("itemCount ")<BR><BR><BR>%&#062;<BR>&#039************end array.asp**********<BR>&#039************subs.asp** *********<BR>&#060;%<BR>&#039EMPTY SESSION LEVEL ARRAYS <BR>sub emptyCart(pNumArr(),qtyArr())<BR> <BR> <BR> &#039DELETE ARRAY CONTENTS<BR> for i = lbound(pNumArr) to ubound(pNumArr)<BR> pNumArr(i)=""<BR> qtyArr(i)=""<BR> next<BR> &#039SET SESSION STUFF<BR> session("itemCount")=0<BR> session("pNumArr") = pNumArr<BR> session("qtyArr") = qtyArr<BR> call resize (pNumArr,qtyArr)<BR>end sub<BR><BR><BR>&#039RESIZE ARRAYS<BR>sub resize (pNumArr(),qtyArr())<BR> itCount = session("itemCount")<BR> redim preserve pNumArr(itcount + 1)<BR> redim preserve qtyArr(itCount + 1)<BR> session("pNumArr")=pNumArr<BR> session("qtyArr")=qtyArr<BR>end sub<BR>%&#062;<BR>&#039*********************end subs.asp**************<BR>if this works,(and it does),<BR> session("pNumArr")=pNumArr<BR> session("qtyArr")=qtyArr<BR>why won&#039t this work?<BR> pNumArr=session("pNumArr")<BR> qtyArr=session("qtyArr")<BR><BR><BR><BR>Thanks in advance,<BR><BR>Adam Perfetti<BR><BR>adam@trinityhosting.com<BR>dev@web pagecity.com<BR>