|
Post by jochen on Apr 16, 2020 22:46:11 GMT
Hi!
I'm trying to code an RSVP task in which each item of my RSVP stream is a column in the table. Now I want to change the color of certain items. I tried the code below (sorry for the clumsy RGB specification, I didn't now how to specify a tuple in a variable). However, it throws an ERROR: at_non_integer. I also tried @$item_column and @($item_column), but with the same error. Is it not possible to refer to a table column by a variable?
Best, Jochen
table rsvp_design 5 9 "1" "2" "3" "4" "X" "6" "7" "8" "B" "0" "1" "2" "3" "4" "5" 5 10 "1" "2" "3" "4" "B" "6" "7" "8" "9" "X" "1" "2" "3" "4" "5"
task rsvp table rsvp_design keys space set $loop_counter 1 while $loop_counter < 16 set $item_column expression $loop_counter + 2 set $R 255 set $G 255 set $B 255 if $loop_counter == @1 or $loop_counter == @2 set $G 0 set $B 0 fi show text @item_column 0 0 $R $G $B while-end
|
|
|
Post by PsyToolkit on Apr 17, 2020 0:25:02 GMT
The value specified after a column identifier always must be a number (that is, no variable allowed as in your example).
With this type of experiment, it is sometimes easier to write a script (on your own computer) to create a sequence and put that in a table.
You can then have each letter as a table row and use the "fixed" option to have it exactly in the order as you wish. I think that is what I would do.
|
|
|
Post by jochen on Apr 17, 2020 10:26:50 GMT
Thanks for the quick reply. I will try next time (I didn't know that there could be several tables per experiment), this time I had already solved it by unrolling the loop, which was not too bad because it contained only 15 items. But of course this code will be somewhat hard to maintain: if I want to change some stimulus property, I will have to change it in 15 places. So your approach is probably preferable.
|
|