up Inquisit Language Reference

setItem function

Sets the item at the specified index.

Member of

<item><html><picture><port><sound><text><video><xid>

Syntax

object.name.setItem(value, index)

Return Type

none

Parameters

Name Type Description
value value The new value for the item.
index integer The index of the item to set. The first item in the list is 1.

Remarks

The setItem function clears the previous value at a specified index and sets it to a new value. When called from a stimulus element, the stimulus item is set.

Examples

The following sets the first item of a text stimulus:

<trial myTrial>
/ onTrialEnd= [text.myText.setItem("Hello world!", 1);]
</trial>

The following sets the last item of a list:

<trial myTrial>
/ onTrialEnd= [item.myitems.setItem(values.newvalue, item.item.itemCount);]
</trial>

Copyright Millisecond Software, LLC. All rights reserved.