Results 1 to 2 of 2

Thread: arrays

  1. #1
    Join Date
    Dec 1969

    Default arrays

    I am declaring a array but i am facing problems,,<BR><BR>dim myarr()<BR>for each x in request.form<BR>y=0<BR>myarr(y)=x (x is a text) <BR>y=y+1<BR>next<BR><BR>myarr(y)=x line says subscript out of range.. if i try substituting a numeric value like myarr(y)=1 then it works fine. <BR><BR><BR>brij <BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: arrays

    Dim myArr()<BR>ReDim myArr(Request.Form.Count)<BR><BR><BR>I think it has a .Count property - see if it errors. Basically, your array needs to be given a size, or when you try and put something in it, that element won&#039;t exist (the "subscript" will be "out of range").<BR><BR>Craig.

Posting Permissions

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