title: VB: how to get the index(es) of an array element if used in For Each
body: <p>i have the following VB Script written in an .asp file</p>
  
  <pre><code>Dim myArr(5, 6) '// a 6 * 7 array
  
  For i = LBound(myArr, 1) to UBound(myArr, 1)
      For j = LBound(myArr, 1) to UBound(myArr, 1)
          myArr(i, j) = "i:" &amp; i &amp; ", j:" &amp; j
      next
  next
  
  Dim i
  i = 0
  
  For Each k In myArr
      Response.Write("i:" &amp; i ", k:" &amp; k &amp; "&lt;br&gt;")
      i = i + 1
  Next
  </code></pre>
  
  <p>using For Each i can iterate through all the array items,
  and the question is how can i get the index for each dimension ?</p>
  
  <p>for example: how can i get k index after 10th loop that is 2 and 4 ?</p>