Hi folks. I am trying to sort a list of phone directories stored in a TXT via a bubblesort using a tempArray. The problem I have that the code breaks on the line that supposed to store the data in the array. This part of a bigger exercise but I need to list data alpha/numeric ascending.
VB Code:
Dim sr As StreamReader Dim sw As StreamWriter Dim temp() As String Dim prompt As String Dim counter, i, j As Integer fn = "PHONELISTS.TXT" 'File with phone directories sr = File.OpenText(f & fn) counter = 0 Do While (sr.Peek <> -1) counter += 1 :confused: [COLOR=Blue][B]temp(i) = sr.ReadLine [/B] [/COLOR] Loop sr.Close() OpenDir(fn, counter) End Sub




Reply With Quote