addItemAt

addItemAt(str:   String;
          index: Integer);

The addItemAt method adds a specified item index to a ComboBox or ListBox control or adds a new row to a Table control at run time.

The parameters of the addItemAt method are listed in the following table.

Parameter Description
str The string expression to add to the control. For Table controls only, use the tab character (character code 09) to separate multiple strings that you want inserted into each column of a newly added row.
index An integer representing the position within the control where the new item or row is placed. For the first item in a list box or combo box, or for the first row in a table control, the index is 1.

The addItemAt method places the item at that specified position within the control. If the sorted property value is set to true, this may upset the sorting process.

Adding an entry can result in the value of the topIndex and listIndex properties for a list box being changed because of the addition. For a Table control, the row, column, leftColumn, and topRow properties can change as a result of the addition.

For the ListBox class, which uses a hierarchy, the following applies.

For the Table class, the following applies.

No sorting is performed, but the insertion of a row may still affect other property values.