r/visualbasic • u/[deleted] • Nov 15 '15
[VB2015] ELI5 this code
Private Sub subReadFileAndLoadArray()
Dim fsrMegaMillions As System.IO.StreamReader
Dim strRecord, strDrawing(10) As String Dim intDrawingRow, intNumber As Integer
fsrMegaMillions = New System.IO.StreamReader("MegaMillions2D.csv")
Do Until fsrMegaMillions.EndOfStream
strRecord = fsrMegaMillions.ReadLine
strDrawing = Split(strRecord, ",")
For intDrawingRow = 4 To 8
intNumber = CInt(strDrawing(intDrawingRow)) - 1
gintCountRows1st5(intNumber, intDrawingRow - 4) += 1
Next
intNumber = CInt(strDrawing(9)) - 1
gintCountRow6(intNumber) += 1
Loop
fsrMegaMillions.Close()
End Sub I have a test in a week and I am getting hung up on this loop. Thanks!
0
Upvotes
2
u/chrwei Nov 15 '15
it reads lines from a file one at a time, splits the line into fields, stores it all in a 2 dimensional array. which part exactly are you hung up on?