Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.
Efficient extraction of selected rows from a Edit Table
Very broad use case:
I have an Edit Table that contains thousands of entries. The user has the facility to multi-select rows in this table for further processing. What this does is toggle a hidden non-databound column in the Table called, lets just say, 'Selected' to True$
What we currently do is loop through the whole list to identify the few lines that are selected.
Is there a way to immiately identify those lines? Basically a BTree.Extract for a non databound array...
I have an Edit Table that contains thousands of entries. The user has the facility to multi-select rows in this table for further processing. What this does is toggle a hidden non-databound column in the Table called, lets just say, 'Selected' to True$
What we currently do is loop through the whole list to identify the few lines that are selected.
Is there a way to immiately identify those lines? Basically a BTree.Extract for a non databound array...

Comments
I'm thinking
- Retrieve the array
- Sort by the "Selected" column so the selected rows are at the top
- Loop through the sorted rows, stopping once you reach the first non-selected row.
Doesn't do a select for you but it does prevent you having to look at every row.If I am being honest, I have done that once or twice before but didnt even thnk of it this time because I was too busy looking at the trees to see the forest.
Of course, in the moments since I wrote this trying to get an efficient solution I am told that the new spec would negate me using it anyway since I am going to have to parse the whole thing row by row for coloring and highlighting purposes.
If you're immediately identifying the row(s) as the user clicks on them, couldn't you store that row position in a UDP (or other hidden field), and build/manage a list of selected row positions? That would give you access to the selected rows without looping or sorting the array. Actually, you could just store each selected row in an UDP array and skip having to extract the array and pull the rows out.
That is another good idea. Easy enough to append to and delete from as a toggle.
Basically maintaining my own index. I like it!
Otherwise there'd be a bit of
The likeness is uncanny!!!