Home > Language Reference > Classes > ChoiceControl

ItemData Property

Value associated with a list item.

Syntax

Public Property Get ItemData(ByVal iIndex As Integer) As Long
Public Property Let ItemData(ByVal iIndex As Integer, ByVal lData As Long)

ParameterDescription
iIndexElement index.
lDataAssociated value.

Remarks

The ItemData property reads or modifies the value associated with each item in the list displayed by the control. The index of the first item is zero whilst the last item is ListCount -1. If the iIndex parameter is outside these limits, a runtime error occurs.

The value associated with each item can be any Long value necessary for your program to work properly. For example, it can be a record number in a list displaying the contents of a database, or the index of an array in a list displaying the array's contents.

It is recommended to always use this property to identify an item in a list. Depending on the sort order specified by the Sorted property, the item index does not necessarily correspond to its insertion order in the list. The introduction page for the ChoiceControl object shows how to use this property to retreive an item in a table.

System requirements

SystemMinimal versionRemarks
Palm OSPalm OS 3.0N/A