Cant seem to load an array from a file

M

Mike

'Declare array to load file
Dim mstrCarinfo(9, 3) As String

'Declare streamreader
Private datvehiclelookup As StreamReader

Private Sub Loadarray()
' Load Array
Dim intCol As Integer
Dim intRow As Integer

Do Until datvehiclelookup.Peek = -1
For intRow = 0 To 9
For intCol = 0 To 3

mstrCarinfo(intRow, intCol) =
datvehiclelookup.ReadLine

Next intCol
Next intRow
Loop
End Sub
 
A

Armin Zingler

Mike said:
'Declare array to load file
Dim mstrCarinfo(9, 3) As String

'Declare streamreader
Private datvehiclelookup As StreamReader

Private Sub Loadarray()
' Load Array
Dim intCol As Integer
Dim intRow As Integer

Do Until datvehiclelookup.Peek = -1
For intRow = 0 To 9
For intCol = 0 To 3

mstrCarinfo(intRow, intCol) =
datvehiclelookup.ReadLine

Next intCol
Next intRow
Loop
End Sub

Do you get a compile error or a runtime exception? Which one? Do you create
a StreamReader somewhere? How is the array written to the file?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top