I need to read a text file twice that I have downloaded. The first time I read the file, I use a ReadLine loop until the line read is = null. How do I reset the TextReader back to the beginning of the inputstream so I can read the file a second time?
Edit: I found that by just reinitiatizing the same inputstream using TextReader1.Initialize(Job.GetInputStream) I could read the inputstream from the beginning again.
If File.Exists(File.DirDefaultExternal,"RiceName1.txt") Then
Dim Reader1 As TextReader
If Reader1.IsInitialized = False Then
Reader1.Initialize(File.OpenInput(File.DirDefaultExternal,"RiceName1.txt"))
End If
Dim line As String
cboBox.Clear
cboBox.Prompt="Select one of your lists "
line=Reader1.ReadLine
Do While line <> Null
Dim pos As Int
pos=line.IndexOf(",")
cboBox.Add(line.SubString2(0,pos))
line=Reader1.ReadLine
Loop
Reader1.Close
End If