Method: Item for PropertyList <Data>
- Updated2024-09-12
- 2 minute(s) read
Internal Data > Methods > Method: Item for PropertyList <Data>
Method: Item for PropertyList <Data>
Returns a single property of the Root object, the ChannelGroup object, or the Channel object which belongs to a specified index.
Set oProperty = Object.Item(Index)
Object | PropertyList <Data> Object with this method |
Index | LongInteger Specifies the index of the property. |
oProperty | Property <Data> Returned object |
![]() | Note You can always omit the Item method because it is the standard element of the collection. |
The example executes the user command MyOnDropPageEvent when dragging groups, channels, or properties onto a worksheet. The user command displays the names of the elements that you dragged onto an object. After you have dragged the properties onto an object, the user command displays the names and the display names of the properties. The dummy commands for CodeCompletion depend on which type the elements and properties are that you drag onto an object:
VBScript | Python |
Report.Events.OnDropPage = "MyOnDropPageEvent" Sub MyOnDropPageEvent(Context, DropContext) Dim sOutput, oMyDropElements, oMyDropProperties, i If DropContext.IsKindOf(eDropDIAdemElement) Then If False Then Set oMyDropElements = Data.Root.ActiveChannelGroup.Channels(1) 'This is a dummy statement for autocompletion Set oMyDropElements = DropContext.DiademElements sOutput = oMyDropElements.Count & " dropped elements:" For i = 1 to oMyDropElements.Count sOutput = sOutput & VBCrLf & "Name: " & oMyDropElements.Item(i).Name Next ElseIf DropContext.IsKindOf(eDropDIAdemProperty) Then If False Then Set oMyDropProperties = Data.Root.ChannelGroups(1).Channels(1).Properties 'This is a dummy statement for autocompletion Set oMyDropProperties = DropContext.DiademProperties sOutput = oMyDropProperties.Count & " dropped properties:" For i = 1 to oMyDropProperties.Count sOutput = sOutput & VBCrLf & "Name: " & oMyDropProperties.Item(i).Name & VBTab & "DisplayName: " & oMyDropProperties.Item(i).DisplayName Next End If Call Msgbox(sOutput) Context.DoProceed = False End Sub