I have a text file which contains an address. I would like to put each line of the text file into separate edittext's in the view
For the number of fields involved the above works but I was just wondering if there was a better or more efficient way of achieving this?
B4X:
Dim TextReader1 As TextReader
TextReader1.Initialize(File.OpenInput(File.DirInternal , "Location.txt"))
Dim line As String
line = TextReader1.ReadLine
For i=0 To 3
If i=0 Then
edtAddress1Stored.text=line
End If
If i=1 Then
edtAddress2Stored.text=line
End If
If i=2 Then
edtAddress3Stored.text=line
End If
If i=3 Then
edtPostCodeStored.text=line
End If
line = TextReader1.ReadLine
Next
TextReader1.Close
For the number of fields involved the above works but I was just wondering if there was a better or more efficient way of achieving this?
Last edited: