iOS Question Read a txt file

Giusy

Active Member
Licensed User
Hi, in B4A I read my txt file so:

B4X:
Private tr As TextReader
tr.Initialize(File.OpenInput(File.DirAssets, "myfile.txt"))

strLines = tr.ReadLine

FOR SS=1 TO 7
strLines = tr.ReadLine
....
....
NEXT SS
tr.Close
[code]

Now in B4I how should i do?
 
D

Deleted member 103

Guest
Hi, in B4A I read my txt file so:

B4X:
Private tr As TextReader
tr.Initialize(File.OpenInput(File.DirAssets, "myfile.txt"))

strLines = tr.ReadLine

FOR SS=1 TO 7
strLines = tr.ReadLine
....
....
NEXT SS
tr.Close
[code]

Now in B4I how should i do?

Very easily:
B4X:
Dim txt As String = File.ReadString(File.DirAssets, "myfile.txt")
 
Upvote 0
Top