mrossen Active Member Licensed User Longtime User Sep 15, 2020 #1 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
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
klaus Expert Licensed User Longtime User Sep 15, 2020 #2 You need to find the row number which contains "canID". Then Table1.UpdateRow(row, Array As String(canID, "0", "255", "255", "255", "255", "255", "255", "255", "255")) Upvote 0
You need to find the row number which contains "canID". Then Table1.UpdateRow(row, Array As String(canID, "0", "255", "255", "255", "255", "255", "255", "255", "255"))
mrossen Active Member Licensed User Longtime User Sep 16, 2020 #3 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
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
klaus Expert Licensed User Longtime User Sep 16, 2020 #4 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
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