Android Question Reading list entries into an array

saeed10051

Active Member
Licensed User
Longtime User
Hi,
I have a question regarding following code
dim name1 as string
dim cd as string
Dim su as stringutils
Dim table as list
Dim cells() as string
Table = su.LoadCsv(File.dirinternal, "myfile.txt", TAB)
' myfile is a tab delimited file with 5 columns, i.e. name, code no, class, area, location
cells = Table.Get(2)
Now if I want to get the entry give in row 2 of the file relevant to name and code no, can I use following code
name1 = cells(0)
cd = cells(1)
or do I need to modify my array for that purpose
 

eurojam

Well-Known Member
Licensed User
Longtime User
I think that should work like you expected:
LoadCSV produces a list of stringarrays, the only thing is, that the array and list a zero based - means starting by index 0. To get the second row must be
B4X:
cells = Table.Get(1)
 
Upvote 0

saeed10051

Active Member
Licensed User
Longtime User
I am getting the row in the cells table, but my question is about getting the column entry, i.e. the the name and code no.
Will I be able to get these specific entries out of the cells array.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…