Inserts the item at the specified index.
<list>
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 list at specified index. When called on a list element, the function inserts an item into the selection pool item. 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>