﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Millisecond Forums » Millisecond Forums » Inquisit 5  » Add 1 to every item in a list</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Sat, 19 Sep 2026 21:10:21 GMT</lastBuildDate><ttl>20</ttl><item><title>Add 1 to every item in a list</title><link>https://forums.millisecond.com/Topic27849.aspx</link><description>Hello,&lt;br/&gt;&lt;br/&gt;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.&lt;br/&gt;&lt;br/&gt;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).&lt;br/&gt;&lt;br/&gt;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?&lt;br/&gt;&lt;br/&gt;Thanks!&lt;br/&gt;</description><pubDate>Tue, 08 Oct 2019 11:48:14 GMT</pubDate><dc:creator>ldb24</dc:creator></item><item><title>RE: Add 1 to every item in a list</title><link>https://forums.millisecond.com/Topic27851.aspx</link><description>Okay, I kind of figured but I thought there may be a better solution. Thanks!</description><pubDate>Tue, 08 Oct 2019 11:48:14 GMT</pubDate><dc:creator>ldb24</dc:creator></item><item><title>RE: Add 1 to every item in a list</title><link>https://forums.millisecond.com/Topic27850.aspx</link><description>&lt;div data-id="27849" class="if-quote-wrapper" unselectable="on" data-guid="1570560049901"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="27849" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="27849" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="27849" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;ldb24 - 10/8/2019&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-27849"&gt;&lt;div class="if-quote-message-margin"&gt;Hello,&lt;br/&gt;&lt;br/&gt;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.&lt;br/&gt;&lt;br/&gt;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).&lt;br/&gt;&lt;br/&gt;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?&lt;br/&gt;&lt;br/&gt;Thanks!&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="27849"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;You would need to loop through all items.&lt;br/&gt;</description><pubDate>Tue, 08 Oct 2019 11:40:59 GMT</pubDate><dc:creator>Dave</dc:creator></item></channel></rss>