Array of arrays

Results 1 to 2 of 2

Thread: Array of arrays

  1. #1
    Join Date
    Dec 1969

    Default Array of arrays

    Hi all!<BR><BR>Basically i&#039;m trying to create a shoping cart. <BR>For this i would like to create an Array which holds another array . I know i can solve this with multi dimensional Arrays but i dont want to use that option.<BR>So here is what i&#039;m trying to do:<BR><BR>CONST SZABVANY_J = 0<BR>CONST ELEKTRONIKUS_DB = 1<BR>CONST ELEKTRONIKUS_AR = 2<BR>CONST PAPIR_DB = 3<BR>CONST PAPIR_AR = 4<BR><BR>dim sid, eformat, pformat, eprice, pprice<BR>dim CARTARRAY() <BR>dim CARTDETAIL(4) <BR>dim CARTSIZE <BR><BR>sid=Request.querystring("sid")<BR>eprice=R equest.querystring("ebrutto")<BR>pprice=Request.qu erystring("pbrutto")<BR>pformat=Request.querystrin g("pformat")<BR>eformat=Request.querystring("eform at")<BR><BR><BR>Function addtocart()<BR>CARTSIZE=Session("CARTSIZE")<BR>if CARTSIZE="" Then<BR> CARTSIZE=0<BR>End if<BR>redim preserve CARTARRAY(CARTSIZE)<BR>CARTDETAIL(SZABVANY_J)=sid< BR>CARTDETAIL(ELEKTRONIKUS_DB)=eformat<BR>CARTDETA IL(ELEKTRONIKUS_AR)=eprice<BR>CARTDETAIL(PAPIR_DB) =pformat<BR>CARTDETAIL(PAPIR_AR)=pprice<BR>CARTARR AY(CARTSIZE)=CARTDETAIL<BR>CARTSIZE=CARTSIZE+1 <BR>Session("CARTSIZE")=CARTSIZE<BR>Session("CARTA RRAY")=CARTARRAY<BR><BR>&#039;Testing the Values in the CartArray <BR>Response.write(CARTARRAY(0)(0)) &#039; Error msg here.. <BR>End Function<BR><BR>Please help me figure out what i&#039;m doing wrong. It seems that i can put the array into the array but when i&#039;m trying to print it out for test reasons. i get error msg: type missmatch

  2. #2
    Join Date
    Dec 1969

    Default RE: Array of arrays

    Try this:<BR><BR>Dim arrTemp<BR>arrTemp = CARTARRAY(0)<BR><BR>Response.write(arrTemp(0)) <BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts