PrtItem.Attr (Function)

Syntax

PrtItem.Attr(index)

PrtItem.Attr(attrib$)

Description

Prototype 1.

Returns an Item Attribute at the specified index from the list which was found by a previous call to GetItemList. The index must be in range from 0 to AttrCount. If the index is out of range, an error is generated.

Prototype 2.

This function returns the Item Attribute associated with the specified PRT Attribute or an empty string if the Item does not have the Attribute.

Example

Dim prt as new Prt

'Get a list of items from PRT and display each of their

'attributes one by one in a message box.

prt.GetItemList

For i = 0 To prt.ItemCount - 1

    For j = 0 To prt.Item(i).AttrCount - 1

        MsgBox prt.Item(i).Attr(j).Id & " = " &

        prt.Item(i).Attr(j).Value

    Next j

Next i

'Get a list of items from PRT again but display their COLOR only

For i = 0 To prt.ItemCount - 1

    For j = 0 To prt.Item(i).AttrCount - 1

        MsgBox prt.Item(i).Attr("COLOR")

    Next j

Next i

More information

PRT Object Model member list.