R
RallyDSM
Private Sub IntializeData()
Dim arr() As String
Dim row As Integer
Dim sLine As String
Dim StockData(row) As Stocks
Dim fstream As IO.StreamReader = New IO.StreamReader(New
IO.FileStream("csvstocks.txt", IO.FileMode.Open))
row = 0
Do
sLine = fstream.ReadLine
arr = sLine.Split(","c)
StockData(row).stockName = arr(0)
StockData(row).numShares = arr(1)
StockData(row).datePurchased = arr(2)
StockData(row).purchasePrice = arr(3)
StockData(row).currentPrice = arr(4)
row = row + 1
Loop Until sLine Is Nothing
fstream.Close()
End Sub
There is my code, when it is ran it comes up with an Out of Bounds on
the line StockData(row).stockName = arr(0)
I've been looking at this for awhile now I can't figure out what I need
to change.
Dim arr() As String
Dim row As Integer
Dim sLine As String
Dim StockData(row) As Stocks
Dim fstream As IO.StreamReader = New IO.StreamReader(New
IO.FileStream("csvstocks.txt", IO.FileMode.Open))
row = 0
Do
sLine = fstream.ReadLine
arr = sLine.Split(","c)
StockData(row).stockName = arr(0)
StockData(row).numShares = arr(1)
StockData(row).datePurchased = arr(2)
StockData(row).purchasePrice = arr(3)
StockData(row).currentPrice = arr(4)
row = row + 1
Loop Until sLine Is Nothing
fstream.Close()
End Sub
There is my code, when it is ran it comes up with an Out of Bounds on
the line StockData(row).stockName = arr(0)
I've been looking at this for awhile now I can't figure out what I need
to change.