up Inquisit Language Reference

insertItem function

Inserts the item at the specified index.

Member of

<list>

Syntax

list.name.insertItem(value, index)

Return Type

none

Parameters

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.

Remarks

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.

Examples

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>

Copyright Millisecond Software, LLC. All rights reserved.