<div dir="ltr"><span><span><span id="ctl03_ctlSearchResultsPostView"><span id="ctl03_ctlSearchResultsPostView_ctlSearchResults_ctl06_ctlPanelBar"><span id="ctl03_ctlSearchResultsPostView_ctlSearchResults_ctl06_ctlPanelBar_lblFullMessage">I
have an experiment with a list object and I would like to move both
forward and backward through the list depending on the keyboard input.
In other words, a 1 moves backwards and a 2 moves forwards in the list.
Below is the code I have that is not working. This occurs after I
display the list item, so the list index has already advanced from 0 to
1. First, I get the current index (which works fine) then I check to
see if it is greater than 1 (i.e. 2 or more) because I can't go
backwards if I am at the first item. If the response = 1 then I set a
new variable called NewIndex which is the currentindex -2 (because it
has already advanced). <br>
<br>
Then I try to set the attribute value back to the new attribute value. But for some reason, that does not work.<br>
<br>
<b>How can I manually set the index of the current list?</b><br>
<br>' My list is called </span></span></span></span></span><span><span><span id="ctl03_ctlSearchResultsPostView"><span id="ctl03_ctlSearchResultsPostView_ctlSearchResults_ctl06_ctlPanelBar"><span id="ctl03_ctlSearchResultsPostView_ctlSearchResults_ctl06_ctlPanelBar_lblFullMessage"><span><span><span id="ctl03_ctlSearchResultsPostView"><span id="ctl03_ctlSearchResultsPostView_ctlSearchResults_ctl06_ctlPanelBar"><span id="ctl03_ctlSearchResultsPostView_ctlSearchResults_ctl06_ctlPanelBar_lblFullMessage">ListOfComputers, and it is a list of computers (the task is computer shopping and subjects need to be able to move back and forth<br><br></span></span></span></span></span>CurrentIndex = c.GetAttrib("ListOfComputers")<br>
<br>
'Check to make sure we are far enough along the list to move backwards<br>if CurrentIndex > 1 then<br>
if ShowMovie.RESP = 1 then<br>'Use -2 instead of minus one because the in line code occurs after the presentation slide so the list index has already advanced one space<br> NewIndex = CurrentIndex - 2<br>
c.SetAttrib "ListOfComputers", NewIndex<br> end if<br>
end if<br>
<br>' This message box shows all of the variables with the values I want, it just does not actually change where on the list the next stimuli occurs. In other words it just keeps running through the list in the predefined order<br>
msgbox("CurrentIndex = " & CurrentIndex & " NewIndex = " & NewIndex &" ShowMovie.RESP = " & ShowMovie.RESP)</span></span></span></span></span></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups "E-Prime" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+unsubscribe@googlegroups.com.<br />
To post to this group, send email to e-prime@googlegroups.com.<br />
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/e-prime/0a5b654c-3415-41b2-88f3-2f8c102f9785%40googlegroups.com">https://groups.google.com/d/msgid/e-prime/0a5b654c-3415-41b2-88f3-2f8c102f9785%40googlegroups.com</a>.<br />
For more options, visit <a href="https://groups.google.com/groups/opt_out">https://groups.google.com/groups/opt_out</a>.<br />