title: Use ReDim for unknown size of array
body: <p>I am currently reading and splitting a file's data into 2 arrays (name and age). I have created them both as arrays of unknown size. This is because I might add lines to my data file, but if I dim them in this way (e.g.name()), an error occurs. However I am unsure of how to use ReDim in this situation.</p>
  
  <pre><code>Dim o As Integer
  Dim name() as string
  Dim age() as integer
  
  r = New System.IO.StreamReader("C:\Users\files\names.txt")
  While r.Peek() &lt;&gt; -1
      v = r.ReadLine()
      temperary = v.Split(".")
      name(o) = temp(0)
      age(o) = temp(1)
      o = o + 1
  End While
  r.Close()
  Catch ex As Exception
      Me.Close()
  End Try
  </code></pre>