|
-
Dec 31st, 2005, 07:55 AM
#1
Thread Starter
Addicted Member
Large file into an array
Hi,
I have a large file, which i need to read into an array.
As i understand, i have to use an arrayList, but my code doesnt work. Surely there's a minor error there somewhere, cause i never used arrays much, and dont know much about their use. Anyway, here's my code:
VB Code:
Dim a As Integer = 0
Dim List As ArrayList
Dim ls As New StreamReader(Application.StartupPath & "/Largefile.txt")
Dim listing As String()
listing = ls.ReadToEnd.Split(vbNewLine)
For Each item As String In listing
List.Add(item)
a += 1
Next
The error is "object reference is not set to an instance of an object", its here: " List.Add(item)"
Thx
They shout: "Give us cheap oil!"
What will they shout when all the oil is gone? "Give us another planet full of oil!"
1 Cigarete takes away 15 minutes of life, 1 minute of laughter gives you 15 minutes of life. What should you do?
Smoke weed! 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|