Android Question Update Flexible Table data row

mrossen

Active Member
Licensed User
Longtime User
Hi,

I have made a table where new data are received every 100 mS.

I add the line to the tabel like this

B4X:
Table1.AddRow(Array As String(canID, "0", "255", "255", "255", "255", "255", "255", "255", "255"))

But when the same "canID" comes next I would like to update the content of the array.

How do I update this row the most efficent way?

Mogens
 

mrossen

Active Member
Licensed User
Longtime User
Hi there is not a function like

B4X:
 Table1.Search(row, col, canID)

I will have do use table1.getvalue(col, row) i a loop to find canID?

this is the fastest way to do it?

Mogens
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
I would use a List, holding the canIDs, in parallel with the Table.
B4X:
row = lstIDs.IndexOf(canID)
If row = -1 Then
    Table1.AddRow(Array As String(canID, "0", "255", "255", "255", "255", "255", "255", "255", "255"))
    lstIDs.Add(canID)
Else
    Table1.UpdateRow(row, Array As String(canID, "0", "255", "255", "255", "255", "255", "255", "255", "255"))
End If
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…