2-Dimensional Array

Results 1 to 2 of 2

Thread: 2-Dimensional Array

  1. #1
    Join Date
    Dec 1969

    Default 2-Dimensional Array

    I have an array of arrays. <BR>I can access the variables fine with - myArray(0,0),myArray(0,1)...<BR><BR>Is it possible to assign another array-variable one of these arrays in a simple way like - <BR>myVar = myArray(0)

  2. #2
    New ASP Guest

    Default RE: 2-Dimensional Array

    You tried to assign a whole array to another array. For example, if Arr1 is an array and Arr2 is another array, the following two assignments are both invalid:<BR>Arr1 = Arr2 &#039 Invalid assignment.<BR>Arr1() = Arr2() &#039 Invalid assignment.<BR><BR>To assign one array to another, you must individually assign the elements. For example:<BR><BR>For count = LBound(Arr2) to UBound(Arr2)<BR>Arr1(count) = Arr2(count)<BR>Next count<BR><BR>Note that you can place a whole array in a Variant, resulting in a single variant variable containing the whole array:<BR><BR>Dim MyArr As Variant<BR>MyVar = Arr2()<BR><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