Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ARRAY

Status
Not open for further replies.

STibbs

Programmer
Joined
Apr 1, 2002
Messages
17
Location
CA
I have a shopping cart set up on an ASP page. I would like the user to only submit things to the cart that are the same vendor type. If the vendor is not the same, I wish to distroy the cart and create a new one. Here is what I have so far.

IF NOT isArray( Session( "savcart" ) ) THEN
dim ShopCart(8,10)
ELSE
ShopCart = Session( "savcart" )
IF (server.HTMLEncode( ShopCart(CARTUOM,1))<>
txtVdr) then
{some code to delete and re-create the cart}
dim ShopCart(8,10)
END IF
END IF

Does anyone have code to to do this?
 
wont redim destory it? redim shopcart(8,10) would empty it wouldnt it?isnt that what u want?or you can always create another variable as shopcart1 if u wish
 
ReDim will allow you to change the size of the array without deleteing the contents. I guess I could redim to (0,0) then redim back to (8,10)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top