Millisecond Forums

Problem using list items for locations

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

By Kolfers - 8/25/2014

Hi all, 
I'm currently using the Inquisit trial version to see if it will work for our needs, and I'm running into a little problem. 

When trying to use a list to define the position of a text, I get very unpredictable behavior, that is

This will work perfectly:
<text stim_square>
/ items = letters
/ select = sequence
/ position = (list.xpositions.item(1), 50)
...
</text>

However, this won't work:

<text stim_square>
/ items = letters
/ select = sequence
/ position = (50,list.xpositions.item(1))
...
</text>

Throwing the following errors:
text.stim_square        position        Setting has invalid text ')    '.
text.stim_square                           Expression 'list.xpositions.item(1' is invalid. Unmatched parenthesis.

I'd think the two are perfectly equivalent, is this a parsing bug?

Thanks, 

Kerwin
By Dave - 8/26/2014

EDIT: I misread the code (missed the presence of the 2nd argument in the 2nd example). Indeed this looks like a parsing error. I apologize for the oversight. In any case, you can work around the issue by using /hposition and /vposition instead of /position as indicated below.

Define /vposition and determine /hposition dynamically.

<text sometext>
/ vposition = 50%
/ hposition = list.somelist.nextvalue
...
</text>

(Or something similar along those lines.)
By Kolfers - 8/26/2014

Hi Dave, 

Thank you for your response, I'm not sure if I understand correctly though:
it seems to me like I am giving two arguments, the only difference being whether I use the list item for the first or the second argument.
So this does in fact work:
(1)
/ position = (list.xpositions.item(1), 50)

While this does not:
(2)
/ position = (50,list.xpositions.item(1))


In both cases list.xposition.item(1) = 50. 
Ideally I would of course like to use the list item for both horizontal and vertical, I'm just trying to point out here that it throws the error when given the item as the second argument, but not when giving it as the first argument. 

To exclude other possibilities, these all work:
/ position = (list.xpositions.currentvalue, list.xpositions.currentvalue)
/ position = (list.xpositions.nextvalue, list.xpositions.nextvalue)

Which seems to me to indicate that the parsing of the parenthesis in (2) are the problem. Which  corresponds to the error messages. 

I did manage to work around the problem. But I still don't understand why the above does not work. Either the (1) should not work either or (2) should work the same as (1)?


By Dave - 8/26/2014

You are correct. I misread your 2nd example (overlooked the 2nd argument) and just corrected my response while you were apparently posting yours.
By Kolfers - 8/26/2014

Hi Dave,

Ok, good to know. Again thank you for the quick and helpful response, the alternatives you mentioned do the job!

cheers, 

Kerwin