learning arrays....can someone explaing this one?

Results 1 to 2 of 2

Thread: learning arrays....can someone explaing this one?

  1. #1
    Join Date
    Dec 1969

    Default learning arrays....can someone explaing this one?

    I have some code that I copied out of a book as I&#039m trying to learn multi dimensional arrays and for loops. When I ran the code, it ran fine and I understood what it was doing...all except one line. The first time I ran it, it threw in a lot of extra <BR> tags. The line originally said:<BR><BR>for i = 0 to ubound(list,2)<BR><BR>When I changed it to:<BR><BR>for i = 0 to ubound(list)<BR><BR>it did not put in any of the extra <BR> tags. Basically what I created was a 2 dimensional array called list with 10 slots that hold a name and email. It is supposed to iterate through this array and print out the name and email. I don&#039t understand what the 2 in the above code is supposed to do, but it came from the book and they don&#039t explain it. Does anyone know? Thanks!!!

  2. #2
    Dan Evans Guest

    Default RE: learning arrays....can someone explaing this o

    The syntax for uBound is uBound(arrayVariable, [dimension]). This means that the "2" meant to access the second dimension of the list array. Removing the "2" meant that you were getting data from the first dimension of the array. In 1D arrays the [dimension] number can be ignored.<BR><BR>Hope this clears it up (As opposed to making you more confused).

Posting Permissions

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