DicomObjects Reference
DicomObjects Reference / DicomAttribute Object / ValueByIndex Property
The 1-based index of the value to retrieve
ValueByIndex Property
Description
Direct access to one of the values of a (potentially) multi-valued attribute
Property type
Read-only property
Syntax
Visual Basic
Public Property ValueByIndex( _
   ByVal Index As Long _
) As Variant
Parameters
Index
The 1-based index of the value to retrieve
Remarks

Attribute.ValueByIndex(n) is equivalent to selecting the nth item of the array returned by Attribute.Value.  However, some languages have poor support for Variant Arrays, and even in Visual Basic the form “Attribute.Value(n)” cannot be used, as n is mistaken for a (superfluous) parameter to the Value property.

Note that arrays rather than single items are returned whenever the VM for an item is anything other than “1” – i.e. when there is the possibility of more than one item, even though in a particular case only a single item may be present.

If the attribute represents a sequence, then the value returned is a DicomDataSet item, representing the nth dataset in the sequence.

The range of values which can be retrieved using this property ranges from 1 to the VM attribute, and the result of attempting to obtain a value outside this range is undefined – depending on the VR an error may or may not be produced.

See Also