List problem
Hi Bo,
If all the entries in List1 are also in List2, why not merge the List1 into List2, and then remove duplicates. It really depends if List2 can have duplicates, and it depends on what columns are duplicated. If we have many columns that need to compared we generate a checksum column in the list, and compare the checksum columns.
Here the code from our standard select method to select all duplicates of a column:
Optimize method
; RB: This method selects all list lines which are duplicates for a specified column
; Note that the column to be tested has to be passed as a character column name.
; The list is passed as a field reference, so this method affects the original list
Begin reversible block
Set current list pList
Clear sort fields
Set sort field pList.[pSortColumn]
Sort list
Clear search class
Set search as calculation {pList.[#L+1].[pSortColumn]=pList.[pSortColumn]|pList.[#L-1].[pSortColumn]=pList.[pSortColumn]}
End reversible block
Search list (From start,Select matches (OR),Deselect non-matches (AND))
Go to next selected line (From start)
If #L=1
; This is a special case that has to be handled separately. If #L=1 the
; above search compares row 0 with row 1, which cannot work. The first two lines have
; to be compared separately with the value in the second line and selected if appropriate.
Do pList.1.$selected.$assign(kFalse)
If pList.1.[pSortColumn]=pList.2.[pSortColumn]
Do pList.1.$selected.$assign(kTrue)
End If
End If
The old commands are faster than the notation commands.
Regards
Rudolf
—–Ursprüngliche Nachricht—–
Von: omnisdev-en [mailto:omnisdev-en-bounces@lists.omnis-dev.com] Im Auftrag von Bo Carleö
Gesendet: Samstag, 3. Februar 2018 14:27
An: OmnisDev List – English
Betreff: List problem
Hi
I have 2 lists. List 1 with 1226 lines. List 2 with 9663 lines.
All lines from list 1 are also included in list 2.
What I want to do is to clear list 2 from all list 1 lines.
Anyone who has a solution for this task?
TIA
Bo
_____________________________________________________________
Manage your list subscriptions at lists.omnis-dev.com Start a new message -> mailto:omnisdev-en@lists.omnis-dev.com
_____________________________________________________________
Manage your list subscriptions at lists.omnis-dev.com
Start a new message -> mailto:omnisdev-en@lists.omnis-dev.com