B4J Question Save table to csv and read

matek

Member
Licensed User
Hello
I am using code to write a table
save

B4X:
    Dim su As StringUtils
    Dim finalList1 As List
finalList1.Initialize
    For Each  row() As Object In T_konf.Items
        Dim temp(row.Length) As String
        For i=0 To row.Length-1
            temp(i) = row(i)
        Next
    finalList1.Add(temp)
Next
    su.SaveCSV(File.DirApp,plik&".csv",",",finalList1)

read
B4X:
Dim su As StringUtils
    Dim finalList As List
    finalList = su.LoadCSV(File.DirApp,nazwa_pliku&".csv",",")
    For Each row() As Object In finalList
    '   
        T_konf.Items.Add(row)
    Next

in the table I get
Przechwytywanie.PNG

where i made a mistake?
 

emexes

Expert
Licensed User
I'm just hypothesising here because nobody else has jumped in, but:

is it possible that your configuration rows are arrays of GUI components/views rather than of the string values contained by those components/views, eg:

B4X:
row(1) = EditText17    'the entire object eg position, height, width, color, font, current text
row(2) = EditText27
row(3) = EditText19

when should be more like:

B4X:
row(1) = EditText17.Text    'just the current text of the object
row(2) = EditText27.Text
row(3) = EditText19.Text
 
Last edited:
Upvote 0
Top