Android Question (TextReader) How do it position to the beginning?

vecino

Well-Known Member
Licensed User
Longtime User
Hello, I have a question:
B4X:
Dim TextReader1 As TextReader
TextReader1.Initialize(File.OpenInput(File.DirRootExternal, "Text.txt"))
Dim line As String
line = TextReader1.ReadLine   
Do While line <> Null
  Log(line) 'write the line to LogCat
  line = TextReader1.ReadLine
Loop

TextReader1.?????????????     '   <--  How do it position to the beginning?

TextReader1.Close
 

DonManfred

Expert
Licensed User
Longtime User
use File.Readlist instead. Probably it i easier

B4X:
    Dim List1 As List
    List1 = File.ReadList(File.DirRootExternal, "Test.txt")
    For i = 0 To List1.Size - 1
        Log(List1.Get(i))
    Next

List1.Get(0) is the first line
 
Upvote 0
Top