iOS Question Array to List

Graeme M itchell

Member
Licensed User
If I want to build a list from an array that has 4 columns and 30 lines i tried the code below but it doesnt work
B4X:
Dim data As List
               data.Initialize
               data.Add(LineArray)
               data.Add(CRLF)
 

William Lancee

Active Member
Licensed User
I started to reply, but realized I don't know enough of what you wanted to do.
What do you want the end result to be? A List so that it can saved with File.WriteList?
What do you want each line in the output to look like?
How is LineArray dimensioned, and what type of object (Int, String..)
 

William Lancee

Active Member
Licensed User
Great.

B4X:
    'You don't need CRLF

    Dim LineArray(30,4) As Int        'or  Float or String or ...
    Dim data As List
    data.Initialize
    For i = 0 To 29
        data.Add(Array(LineArray(i,0), LineArray(i,1), LineArray(i,2), LineArray(i,3)))
    Next
    B4XTable1.SetData(data)
 
Last edited:
Top