Group: Forum Members
Posts: 13,
Visits: 47
|
Hello,
This may be a basic question but I'm curious about the most efficient way to add a value to each item in a list.
I'm trying to count how many trials there have been since the last time an item was shown (out of a list of 28 items). Right now I have my list of items (say list.stimlistname), then a separate list (list.numSinceLastTrial) to track how many trials it's been since each item was shown (using the selection mode list.stimlistname.current index for list.numSinceLastTrial).
On a given trial where 1 stimulus is shown, I'd like to reset the value for that item in the list.numSinceLastTrial to zero and add 1 to all the other items. Would something like list.numSinceLastTrial.items += 1 work followed by a list.numSinceLastTrial.setitem(0, list.stimlistname.currentindex) to set the current one to 0? Or would I need to do a loop through all items?
Thanks!
|