getIndex

Syntax

<Path>.getIndex(DialogItem:string) → integer

The method getIndex returns the number of the item of type New List Box and the New Drop-Down List Box or the New Tab Page.

The method returns 0, when the drop-down list box does not contain any items. When it does contain items, and no item is selected, the method returns 1, i.e., the Dialog automatically selects the first item in the list.

When you assign another list, and if it is possible, the Dialog selects the item at the same position in the list box.

When you assign another list and it is not possible to select the same position in the list box that the previous selection had, the Dialog automatically selects the first item in the new list.

Parameter

The parameter DialogItem of data type string designates the list box, the drop-down list box or the tab. The leftmost tab has the number 1.

Return Value

The return value has the data type integer.

The method returns 0, when the drop-down list box does not contain any items. When it does contain items, and no item is selected, the method returns 1, i.e., the Dialog automatically selects the first item in the list.

Example

print MyDialog.getIndex("doors")
print MyDialog.getIndex("units")

Related Topics

Position of the item in the Items table

setIndex