Inserts the item at the specified index.
none
Name | Type | Description |
---|---|---|
value | value | The value for the item. |
index | integer | The index where the item is inserted. The first item in the list is 0. |
The insertItem function inserts a value into the item list at specified index. When called from a stimulus element, a stimulus item is inserted. This function causes the list size to grow by one.
The following inserts the first item of a text stimulus:
<trial myTrial>
/ onTrialEnd= [text.myText.insertItem("Hello world!", 0);]
</trial>
The following inserts an item into the middle of the selection pool of a list:
<trial myTrial>
/ onTrialEnd= [list.mylist.insertItem(values.newvalue, list.mylist.itemCount / 2);]
</trial>