Reputation: 60691
Public extreme_foods As New System.Collections.ArrayList()
Dim i As Integer
i = 1
For Each s In split2
extreme_foods(i) = s
i = i + 1
Next
anyone know why extreme_foods(i)=s is giving INDEX OUT OF RANGE??
Upvotes: 0
Views: 1235
Reputation: 32957
If I understand your code, you're trying to add elements to the ArrayList. I think you'd want to use the Add() method. So something like:
For Each s In split2
extreme_foods.Add(s)
Next
I'm assuming that split2 is a Collection you've created somewhere else in your code.
Upvotes: 1