title: ArrayList with Arrays
body: <p>It seems that more "complex" ArrayLists are not widely used, since I'm unable to find any concrete, helpful info about it.</p>
  
  <p>I'm trying to create an ArrayList of Arrays (and eventually an ArrayList of ArrayLists of Arrays), but I seem unable to either add Arrays to the ArrayList, or access the Array's elements. All this is done using VBScript in QTP.</p>
  
  <p>(The code reads from an Excel file, which is working fine.)</p>
  
  <pre><code>Set my_sheet = ExcelObject.sheets.item(testCaseSheet)
  testCase     = CreateObject("System.Collections.ArrayList")
  
  Function getTestsCaseActions (row, col)
      Do While my_sheet.cells(row, 2).Value &lt;&gt; ""
          MsgBox tempArray(0) &amp; " -&gt; " &amp; tempArray(1) 'WORKS FINE - THE VALUES ARE PRINTED
          testCase.Add tempArray
  
          row = row+2
      Loop
      End Function
  
  getTestsCaseActions 3, 4
  
  'This is not working - how do I access the arrays and their values in the arraylist?
  For Each ArrayItem in testCase
      MsgBox ArrayItem(0)' &amp; ", " &amp; ArrayItem(1)
      'MsgBox "Hey!"
  Next
  </code></pre>
  
  <p>Now, I realize that <code>For Each ArrayItem in testCase</code> is probably wrong, but I cannot find out what to use? The elements added to the ArrayList are, after all, Arrays. If I uncomment the line <code>MsgBox "Hey!"</code>, it's written once, even though the ArrayList should have 3 Arrays.</p>