Millisecond Forums

error message: parameter is out of range. What am I doing wrong?

https://forums.millisecond.com/Topic31032.aspx

By SWIECHE - 3/10/2021

Hi, I want to create a block in which participants are presented with a word (either green or red). If a green word appears (Fillercue2_R), and participants fail to click '1' before the timeout, the correct associated word should appear in blue (Fillertarget2_R). For some reason, this code is not working. It says - "parameter is out of range", but I do not understand why.
Any help is appreciated, thanks!

This is my code (not running!):
<defaults>
/canvasaspectratio = (4,3)
/minimumversion = "6.2.1.0"
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/txbgcolor = white
/ txcolor = black
/ screencolor = white
/ inputdevice = mouse
</defaults>

<parameters>
/wordHeight = 5%                        
/phase1incorrect = 2500                                
/phase2Timeout = 5000                    
</parameters>

<data>
/ columns = (
values.index_FillercuewordS, values.FillercuewordS,
values.index_FillercuewordR, values.FillercuewordR, values.index_FillerrecallwordR, values.FillerrecallwordR)
</data>

<values>
/index_FillercuewordS = 0
/index_FillercuewordR = 0
/index_FillerrecallwordR = 0

/FillercuewordS = ""
/FillercuewordR = ""
/FillerrecallwordR = ""
</values>

<item Fillercue_S>
/ 1="BOND"
/ 2="GARAGE"
</item>

<list Fillercuelist_S>
/ poolsize = 2
/ replace = false
/ selectionmode =random
/ selectionrate = always
</list>

<item Fillercue_R>
/ 1= "ACID"
/ 2= "PRIZE"
</item>

<list Fillercuelist_R>
/ poolsize = 2
/ replace = false
/ selectionmode =random
/ selectionrate = always
</list>

<item Fillertarget_R>
/ 1= "DYNAMITE"
/ 2= "QUIZ"
</item>

<list Fillertargetlist_R>
/ poolsize = 2
/ selectionmode = list.Fillercuelist_R.currentindex
</list>

<text Fillercue2_S>
/ items = ("<%item.Fillercue_S.item(values.index_FillercuewordS)%>")
/ position = (49%, 50%)
/ fontstyle = ("Arial", parameters.wordHeight, true, false, false, false, 5, 1)
/ color = red
/ vjustify = center
</text>

<text Fillercue2_R>
/ items = ("<%item.Fillercue_R.item(values.index_FillercuewordR)%>")
/ position = (49%, 50%)
/ fontstyle = ("Arial", parameters.wordHeight, true, false, false, false, 5, 1)
/ color = green
/ vjustify = center
</text>

<text Fillertarget2_R>
/items= ("<%item.Fillertarget_R.item(values.index_FillercuewordR)%>")
/ position = (49%, 50%)
/ fontstyle = ("Arial", parameters.wordHeight, true, false, false, false, 5, 1)
/ color = blue
/ vjustify = center
</text>


<trial phaseII_FillerRPair>
/ pretrialpause = 200
/ stimulusframes = [1 = Fillercue2_R]
/ recorddata = false
/ inputdevice = keyboard
/ errormessage = true(Fillertarget2_R, 2500)
/timeout = parameters.phase2Timeout
/ validresponse = ("1", 0)
/ correctresponse = ("1")
</trial>

<trial phaseII_FillerSPair>
/ pretrialpause = 200
/ stimulusframes = [1 = Fillercue2_S]
/ recorddata = false
/ inputdevice = keyboard
/timeout = parameters.phase2Timeout
/ validresponse = ("1", 0)
/ correctresponse = ("")
</trial>


<block practiceII>
/ trials = [1-2 = noreplace(trial.phaseII_FillerRPair, trial.phaseII_FillerSPair)]
</block>

<expt>
/ blocks = [
    1 = practiceII
]
</expt>
By Dave - 3/10/2021

SWIECHE - 3/10/2021
Hi, I want to create a block in which participants are presented with a word (either green or red). If a green word appears (Fillercue2_R), and participants fail to click '1' before the timeout, the correct associated word should appear in blue (Fillertarget2_R). For some reason, this code is not working. It says - "parameter is out of range", but I do not understand why.
Any help is appreciated, thanks!

This is my code (not running!):
<defaults>
/canvasaspectratio = (4,3)
/minimumversion = "6.2.1.0"
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/txbgcolor = white
/ txcolor = black
/ screencolor = white
/ inputdevice = mouse
</defaults>

<parameters>
/wordHeight = 5%                        
/phase1incorrect = 2500                                
/phase2Timeout = 5000                    
</parameters>

<data>
/ columns = (
values.index_FillercuewordS, values.FillercuewordS,
values.index_FillercuewordR, values.FillercuewordR, values.index_FillerrecallwordR, values.FillerrecallwordR)
</data>

<values>
/index_FillercuewordS = 0
/index_FillercuewordR = 0
/index_FillerrecallwordR = 0

/FillercuewordS = ""
/FillercuewordR = ""
/FillerrecallwordR = ""
</values>

<item Fillercue_S>
/ 1="BOND"
/ 2="GARAGE"
</item>

<list Fillercuelist_S>
/ poolsize = 2
/ replace = false
/ selectionmode =random
/ selectionrate = always
</list>

<item Fillercue_R>
/ 1= "ACID"
/ 2= "PRIZE"
</item>

<list Fillercuelist_R>
/ poolsize = 2
/ replace = false
/ selectionmode =random
/ selectionrate = always
</list>

<item Fillertarget_R>
/ 1= "DYNAMITE"
/ 2= "QUIZ"
</item>

<list Fillertargetlist_R>
/ poolsize = 2
/ selectionmode = list.Fillercuelist_R.currentindex
</list>

<text Fillercue2_S>
/ items = ("<%item.Fillercue_S.item(values.index_FillercuewordS)%>")
/ position = (49%, 50%)
/ fontstyle = ("Arial", parameters.wordHeight, true, false, false, false, 5, 1)
/ color = red
/ vjustify = center
</text>

<text Fillercue2_R>
/ items = ("<%item.Fillercue_R.item(values.index_FillercuewordR)%>")
/ position = (49%, 50%)
/ fontstyle = ("Arial", parameters.wordHeight, true, false, false, false, 5, 1)
/ color = green
/ vjustify = center
</text>

<text Fillertarget2_R>
/items= ("<%item.Fillertarget_R.item(values.index_FillercuewordR)%>")
/ position = (49%, 50%)
/ fontstyle = ("Arial", parameters.wordHeight, true, false, false, false, 5, 1)
/ color = blue
/ vjustify = center
</text>


<trial phaseII_FillerRPair>
/ pretrialpause = 200
/ stimulusframes = [1 = Fillercue2_R]
/ recorddata = false
/ inputdevice = keyboard
/ errormessage = true(Fillertarget2_R, 2500)
/timeout = parameters.phase2Timeout
/ validresponse = ("1", 0)
/ correctresponse = ("1")
</trial>

<trial phaseII_FillerSPair>
/ pretrialpause = 200
/ stimulusframes = [1 = Fillercue2_S]
/ recorddata = false
/ inputdevice = keyboard
/timeout = parameters.phase2Timeout
/ validresponse = ("1", 0)
/ correctresponse = ("")
</trial>


<block practiceII>
/ trials = [1-2 = noreplace(trial.phaseII_FillerRPair, trial.phaseII_FillerSPair)]
</block>

<expt>
/ blocks = [
    1 = practiceII
]
</expt>

<values>
/index_FillercuewordS = 0
/index_FillercuewordR = 0
/index_FillerrecallwordR = 0
...
</values>

0 is not a valid index number.

<text Fillercue2_R>
/ items = ("<%item.Fillercue_R.item(values.index_FillercuewordR)%>")
/ position = (49%, 50%)
/ fontstyle = ("Arial", parameters.wordHeight, true, false, false, false, 5, 1)
/ color = green
/ vjustify = center
</text>

Initialize your variables properly, i.e. make sure they're of a valid type and in a valid range.

<values>
/index_FillercuewordS = 1
/index_FillercuewordR = 1
/index_FillerrecallwordR = 1
...
</values>
By SWIECHE - 3/10/2021

Thanks for the quick reply!
Unfortunately, when I do this, all it ever shows me are the words 'bond' and 'acid', and never the second one from the list (even if I set it to more trials). Do you have an idea how to solve this issue?
I also have other parts of the task where I indexed to 0 in the beginning, and there it works perfectly, which is why I am confused. (I can attach the whole script if you prefer although it is quite long).
By Dave - 3/10/2021

SWIECHE - 3/10/2021
Thanks for the quick reply!
Unfortunately, when I do this, all it ever shows me are the words 'bond' and 'acid', and never the second one from the list (even if I set it to more trials). Do you have an idea how to solve this issue?
I also have other parts of the task where I indexed to 0 in the beginning, and there it works perfectly, which is why I am confused. (I can attach the whole script if you prefer although it is quite long).

You're not setting the variables to any other value anywhere in the script.