B4X:
Sub btnFiles_Click
Dim su As StringUtils
Dim Table As List
Dim fName, pegName As String
Dim fd As FileDialog
Dim fSize As Int
table.Initialize
fd.FastScroll = True
fd.FilePath =File.DirRootExternal&"/Android/data/encoded.b4a/files/encoded"
fd.FileFilter = ".cat"
If fd.Show("Select Catalog File", "Yes", "No", "", Null) =DialogResponse.POSITIVE Then
Table = su.LoadCSV(fd.FilePath, fd.ChosenName, ",")
Log(fd.FilePath&" , "&fd.ChosenName)
For i = 0 To table.Size - 1
pegName = table.Get(i)
Log(pegName)
Next
End If
End Sub
I'm trying to read a file that contains imagefile names:
"1.gif","2.gif","3.gif","4.gif","5.gif","6.gif","7.gif","8.gif"
I get an error at this line: Table = su.LoadCSV(fd.FilePath, fd.ChosenName, ",")
java.lang.StringIndexOutOfBoundsException
What am I doing wrong?