title: Collection of list of integer changing number to access the different variable names
body: <pre><code>Public p1 = New List(Of Integer)({1, 2, 3, 4, 5, 6, 7, 8, 9, 10})
  Public p2 = New List(Of Integer)({5, 4, 6, 7, 3, 8, 9, 10, 2, 11})
  Public p3 = New List(Of Integer)({11, 8, 10, 9, 7, 12, 6, 13, 14, 15})
  </code></pre>
  <p>I want to display the list p depending on how much is A. if a is 1 then it will be p1, if a is 2 then it will be p2. how can i access the list using this loop without having to manually write the code so many times.</p>
  <pre><code>   For a As Integer = 1 To 20
                  If strDigit(str) = a Then
                      If a = 1 Then
                          Dim astr As Integer = 0
                          For Each num In p1
                              astr = Val(astr) + 1
                              If num + 1 &gt;= 1 AndAlso num + 1 &lt;= 1000 Then
                                  If pos &lt; 5 Then
  
                                  Else
  
                                  End If
                              End If
                          Next
                      ElseIf a = 2 Then
                          For Each num In p2
                              Dim astr As Integer = 0
                              If num + 1 &gt;= 1 AndAlso num + 1 &lt;= 1000 Then
                                  If pos &lt; 5 Then
  
                                  Else
  
                                  End If
                              End If
                          Next
                      ElseIf a = 3 Then
                          For Each num In p3
                              Dim astr As Integer = 0
                              astr = Val(astr) + 1
                              If num + 1 &gt;= 1 AndAlso num + 1 &lt;= 1000 Then
                                  If pos &lt; 5 Then
  
                                  Else
  
                              End If
                          Next
  </code></pre>
  <p>This should normally be the case, but it doesn't work that way.</p>
  <pre><code>   For a As Integer = 1 To 20
                  If strDigit(str) = a Then
                      If a = 1 Then ' remove line
                          Dim astr As Integer = 0
                          For Each num In p(a) ' here
                              astr = Val(astr) + 1
                              If num + 1 &gt;= 1 AndAlso num + 1 &lt;= 1000 Then
                                  If pos &lt; 5 Then
  
                                  Else
  
                                  End If
                              End If
                          Next
                        End If
  </code></pre>