VB - Structures and Split : I am having difficulty with my vb program as my structure array will not fill with data from a text file which has been split using the split command. Puzzled. Any suggestions would be great. Code is below.

Cheers
Ewan


Imports System.IO

Public Class Form1

    Public Structure ScavRecord
        Public latitude As String
        Public longitude As String
        Public message As String
        Public encrypted As String
    End Structure

    Dim Scav(4) As ScavRecord
    Dim nextScav As Integer

    Private Sub btnView_Click(sender As Object, e As EventArgs) Handles btnView.Click

        Dim read As New StreamReader("F:\Higher Computing Science\Assignment\files for candidates\messages.txt")
        nextScav = 0
        Do
            Dim temp As String = read.ReadLine()
            Dim seperated As String() = temp.Split(",")


            Scav(nextScav).latitude = seperated(0)
            Scav(nextScav).longitude = seperated(1)
            Scav(nextScav).message = seperated(2)
            nextScav = nextScav + 1
            ListBox.Items.Add(Scav(nextScav).latitude)
            ListBox.Items.Add(Scav(nextScav).longitude)
            ListBox.Items.Add(Scav(nextScav).message)

        Loop Until read.EndOfStream()


    End Sub



End Class


