06-17-2014, 12:16 AM
Your problem lies within this line:
[code2=vbnet]Dim listIndexes As List(Of Integer) = Nothing[/code2]
So when you try to add items to the listIndexes variable, you are actually trying to add items to Nothing, hence your error. Thus, you need to initialize the list before putting anything into it. Try changing it to something like:
[code2=vbnet]Dim listIndexes As List(Of Integer) = New List(Of Integer)[/code2]
[code2=vbnet]Dim listIndexes As List(Of Integer) = Nothing[/code2]
So when you try to add items to the listIndexes variable, you are actually trying to add items to Nothing, hence your error. Thus, you need to initialize the list before putting anything into it. Try changing it to something like:
[code2=vbnet]Dim listIndexes As List(Of Integer) = New List(Of Integer)[/code2]