How do you want to store the array? CSV? XML? Binary?
Another great .NET technique is to understand and implement Object Serialization. Here is an example:
Import the following namespace:
Imports System.Runtime.Serialization.Formatters.Binary
Create a new Structure:
<Serializable()> Public Structure Person
Dim Name As String
Dim Age As Integer
Dim Income As Decimal
End Structure
Now, create an instance of this structure and populate it.
Write it to your file:
P = New Person()
P.Name = "Joe Doe"
P.Age = 35
P.Income = 28500
BinFormatter.Serialize("c:\MyFile.txt", P)
FS = New System.IO.FileStream _
("c:\MyFile.txt", IO.FileMode.OpenOrCreate)
Dim obj As Object
Dim P As Person()
Do
obj = BinFormatter.Deserialize(FS)
If obj.GetType Is GetType(Person) Then
P = CType(obj, Person)
' Process the P objext
End If
Loop While FS.Position < FS.Length - 1
FS.Close()
The object P object will now contain the Person object you serialized previously.
Hope this helps.