Array goes Awry

Results 1 to 2 of 2

Thread: Array goes Awry

  1. #1
    Join Date
    Dec 1969

    Default Array goes Awry

    This array codes fails on arr(1) . But it works fine if I chane the name to Bob1. Why is that?<BR><BR>x=1<BR>for each item in request.form<BR>&#039;response.write (request.form("bob"&x))<BR>dropdown=request.form(" bob"&x)<BR>arr=split(dropdown, "!@#")<BR><BR>&#039;response.write (dropdown)<BR><BR>response.write (arr(0))<BR>response.write (arr(1))<BR><BR>x =x+1<BR>next<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Array goes Awry

    you&#039;re doing it wrong..<BR><BR>if Request.Form.Count &#062; 0 then<BR> redim myArr(Request.Form.Count-1)<BR> i = 0<BR> for each item in Request.Form<BR> myArr(i) = item<BR> i = i + 1<BR> next<BR>end if<BR><BR>you&#039;re using the for each... in ...., but you&#039;re not doing anything with it!

Posting Permissions

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