I dont' know why I can't figure this out, but I don't wanna spend anymore time on it and I know someone knows the answer here. Very simple question. Here's my code:
I don't want to dim companyids with an index of 200, I would like it to only initialize as many elements as it needs. But I can't figure out how to initialize it without putting in all of the elements at once (impossible, it must run through that loop) or putting in a static index like I have done above. How can I initialize this array so that its number of elements is dynamic and can change everytime?
Thanks!
VB.NET:
Dim companyids(200) As String
myReader = File.OpenText(ComboBox1.Text + "SPE\DI_IR.upc")
For i As Integer = 1 To diskdirlines
companyids(i) = myReader.ReadLine().Substring(2, 4)
Next
I don't want to dim companyids with an index of 200, I would like it to only initialize as many elements as it needs. But I can't figure out how to initialize it without putting in all of the elements at once (impossible, it must run through that loop) or putting in a static index like I have done above. How can I initialize this array so that its number of elements is dynamic and can change everytime?
Thanks!