DIAdem Help

Content Type
Programming Language
Current manual
Table of Contents

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)
ObjectAssignmentList <Data>
Object with this method
IndexVariant
Specifies the index or the text value (property Value) of the assignment.
oAssignmentAssignment <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:

VBScriptPython

 

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)
In This Section
Was this information helpful?