title: vb.Net - Looping through array returns error: expression of type which is not a collection type
body: <p>I am trying to get the index value of an array by using a for Each loop. 
  I am making an error in my code that I do not know how to correct. </p>
  
  <p>I cannot loop through the ArrayList because it is not a number.</p>
  
  <pre><code>Dim num As Integer = 0
  If Not IsNothing(BreadCrumbIDs) Then
      For Each num In BreadCrumbIDs
          If num &gt;= 0 And num &lt;= 1 Then
              Console.WriteLine(num)
          Else
              ' Do nothing
          End If
      Next
  End If
  </code></pre>
  
  <p>I would like to loop throught the arrylist and obtain the index/ numeric values of it. </p>
  
  <p>Let's say BreadCrumbsIds contains:</p>
  
  <p>0 - shoes
  1 - boots
  2 - leather boots</p>
  
  <p>I want to do something when the values are between 0 and 1 and something else when value is 2.</p>
  
  <p>The Array List property code:</p>
  
  <pre><code>    Public Property BreadCrumbIDs() As ArrayList
          Get
              Return bcIDs
          End Get
          Set(ByVal value As ArrayList)
              bcIDs = value
          End Set
      End Property
  </code></pre>