Method: Item for AssignmentList <Data>
- Updated2024-09-12
- 2 minute(s) read
Internal Data > Methods > Method: Item for AssignmentList <Data>
Method: Item for AssignmentList <Data>
Returns the assignment of a specified index in the script interface for internal data.
Set oAssignment = Object.Item(Index)
Object | AssignmentList <Data> Object with this method |
Index | Variant Specifies the index or the text value (property Value) of the assignment. |
oAssignment | Assignment <Data> Returned object |
![]() | Note DIAdem always orders the list of assignments in the ascending order of the Definition property. If you used the methods Add or Remove to change the list of assignments, the index no longer corresponds with the previous position of the assignment in the list. |
![]() | Note If you use a text (property Value) to access an assignment, DIAdem returns the first element in the list if the texts have the same name within the list. |
The following example generates an assignment channel with three assignments and displays the definition value and the text value of the second assignment:
VBScript | Python |
Dim oMyGrp, oMyChn, oMyAssgnList Set oMyGrp = Data.Root.ChannelGroups(1) Set oMyChn = oMyGrp.Channels.AddAssignmentChannel("MyAssignmentChn","Default Value") Set oMyAssgnList = oMyChn.AssignmentList Call oMyAssgnList.Add("text1",10) Call oMyAssgnList.Add("text2",20) Call oMyAssgnList.Add("text3",30) Call MsgBoxDisp(oMyAssgnList.Item(2).Value & " - " & oMyAssgnList.Item("text2").Definition)