B4J Question Save tableview items to file

Discussion in 'B4J Questions' started by Luciano Boscolo, Sep 8, 2015.

  1. Luciano Boscolo

    Luciano Boscolo Member Licensed User

    I'd like to save to a txt file the items currently existing in a tableview.
    I have this code but the rows written in the txt file are like this one:
    [Ljava.lang.String;@514c7262

    Code:
    File.OpenOutput(LogFolder,LogFilename,True)
    Dim LogList As List
    LogList.Initialize
               
    For c = 0 To TableView1.Items.Size - 1
         LogList.Add(TableView1.Items.Get(c))
         
    Log(LogList.Get(c))
    Next
    File.WriteList(LogFolder,LogFilename,LogList)
    What am I doing wrong?
    Thank you
     
  2. Luciano Boscolo

    Luciano Boscolo Member Licensed User

    Well, sorry. I changed my code with:

    Code:
    File.OpenOutput(LogFolder,LogFilename,True)
    Dim LogList As List
    LogList.Initialize
             
    For c = 0 To TableView1.Items.Size - 1
        
    Dim r() As String = TableView1.Items.Get(c)
        LogList.Add(r(
    0))
        
    Log (r(0))
    Next
    File.WriteList(LogFolder,LogFilename,LogList)
    and now it works.
     
    Last edited: Sep 8, 2015
    Tirs and GMan like this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice