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:
  1. Dim a As Integer = 0
  2.         Dim List As ArrayList  
  3. Dim ls As New StreamReader(Application.StartupPath & "/Largefile.txt")
  4.         Dim listing As String()
  5.         listing = ls.ReadToEnd.Split(vbNewLine)
  6.         For Each item As String In listing
  7.             List.Add(item)
  8.             a += 1
  9.         Next

The error is "object reference is not set to an instance of an object", its here: " List.Add(item)"

Thx