Method: AddElementList for FreeElementList <DataFinder>



DIAdem 2018ヘルプ


発行年月: 2018年6月
製品番号: 370858P-0112
製品情報を参照

ダウンロード (Windowsのみ)


DIAdem 2017 ヘルプ
DIAdem 2018 ヘルプ
DIAdem 2019 ヘルプ
DIAdem 2020 ヘルプ
DIAdem 2020 SP1 ヘルプ

Connects in the object-oriented script interface in DIAdem NAVIGATOR two element lists of a DataFinder.

Object.AddElementList(DataFinderElementList, [ListMergeMode])
ObjectFreeElementList <DataFinder>
Object with this method
DataFinderElementListObject
Specifies a list with data elements.
[ListMergeMode]Variant
Specifies how DIAdem connects the Element lists.
0
ListMergeModeAdd 
Merges the second Element list with the first element list (default). Example:
Element List 1: [5,10,15,20,25]
Element List 2: [10,20,30,40,50]
=> [5,10,15,20,25,10,20,30,40,50]
 1
ListMergeModeUnion 
Creates the union from both Element lists. Elements from the second Element list, which are also in the first Element list, are left out. Example:
Element List 1: [5,10,15,20,25]
Element List 2: [10,20,30,40,50]
=> [5,10,15,20,25,30,40,50]
 2
ListMergeModeIntersection 
Creates the intersection from both Element lists. Elements from the second Element list, which are not in the first Element list, are left out. Example:
Element List 1: [5,10,15,20,25]
Element List 2: [10,20,30,40,50]
=> [10,20]
 3
ListMergeModeDifference 
Creates a new Element list from the elements of the first Element list, which are not in the second Element list. Example:
Element List 1: [5,10,15,20,25]
Element List 2: [10,20,30,40,50]
=> [5,15,25]
 4
ListMergeModeSymetricDifference 
Creates a new Element list from the elements which are only in one of the two Element lists. Example:
Element List 1: [5,10,15,20,25]
Element List 2: [10,20,30,40,50]
=> [5,15,25,30,40,50]

The following example generates two element lists with search results and connects the elements of the second list in two different ways with the first list:

Dim oMyDataFinder, oMyElementList1, oMyElementList2, oMyQuery1, oMyQuery2, oMyResults
Set oMyDataFinder = Navigator.ConnectDataFinder("My DataFinder")

'First Query
Set oMyQuery1 = oMyDataFinder.CreateQuery(eTextQuery)
oMyQuery1.Text = "TR_M17_QT_32-1"
Call oMyDataFinder.SearchElements(oMyQuery1)
Set oMyResults = oMyDataFinder.ResultsElements
Set oMyElementList1 = oMyDataFinder.CreateElementList
Call oMyElementList1.AddElementList(oMyResults)

'Second Query
Set oMyQuery2 = oMyDataFinder.CreateQuery(eTextQuery)
oMyQuery2.Text = "TR_M17_QT_32-4"
Call oMyDataFinder.SearchElements(oMyQuery2)
Set oMyResults = oMyDataFinder.ResultsElements
Set oMyElementList2 = oMyDataFinder.CreateElementList
Call oMyElementList2.AddElementList(oMyResults)

'Combining via ListMergeModeAdd
Call oMyElementList1.AddElementList(oMyElementList2, ListMergeModeAdd)
Call MsgBoxDisp("Sum of Elements (ListMergeModeAdd): " & oMyElementList1.Count)

'Combining via ListMergeModeIntersection
Call oMyElementList1.AddElementList(oMyElementList2, ListMergeModeIntersection)
Call MsgBoxDisp("Sum of Elements (ListMergeModeIntersection): " & oMyElementList1.Count)


この記事は役に立ちましたか。

役に立たなかった