<div style="font-family: arial, sans-serif;">Hi all,</div><div style="font-family: arial, sans-serif;"> In my experiment I have a condition called "Either" in a list object it is defined as "Cue" and presents an "E" on the screen to the subject. During this condition subjects can press either "n" or "b" on the keyboard. During each block I want to count the number of "n" responses and the number of "b" responses separately, then present the separate counts in a text object at the end of each block. </div><div style="font-family: arial, sans-serif;"><br></div><div style="font-family: arial, sans-serif;">I've pasted in the coding I've done here and hope that it makes some sense, please feel free to ask me questions if it does not. Here I create counting variables "count_n" and "count_b", set them to 0, then set the Attributes "total_n" and "total_b"which are scripted so that during the "Either" condition when "n" is selected "total_n" should reference "count_n" and add one (+1); when"b" is selected "total_b" should reference "count_b" and add one (+1). </div><div style="font-family: arial, sans-serif;"><br></div><div style="font-family: arial, sans-serif;">In the user script:</div><div style="font-family: arial, sans-serif;">' Block choice variable</div><div style="font-family: arial, sans-serif;">Dim count_n As Integer</div><div style="font-family: arial, sans-serif;">Dim count_b As Integer</div><div style="font-family: arial, sans-serif;">Dim total_n As Integer</div><div style="font-family: arial, sans-serif;">Dim total_b As Integer <br clear="all"><div><br></div><div>In FirstTrialITI: (bit of Inline script, I believe it repeats after each trial)</div><div><div>count_n = 0</div><div>count_b = 0</div><div><br></div><div>In TMS: (InLine script that runs a block)</div><div><div>' choice_selection</div><div>count_n = count_n +1</div><div>count_b = count_b +1</div><div><br></div><div>If ((c.GetAttrib("Cue") = "E") And (currentresponse = ("n"))) Then </div><div>c.SetAttrib "total_n", count_n</div><div>End If</div><div><br></div><div>If ((c.GetAttrib("Cue") = "E") And (currentresponse = ("b"))) Then </div><div>c.SetAttrib "total_b", count_b</div><div>End If</div><div><br></div><div>I can see in the data file it creates columns for "total_b" and "total_n", but it counts them together!</div><div><br></div><div><div>total_b<span style="white-space: pre-wrap;">      </span>total_n</div><div>1<span style="white-space: pre-wrap;">                </span>NULL</div><div>NULL<span style="white-space: pre-wrap;">      </span>2</div><div>3<span style="white-space: pre-wrap;">             </span>NULL</div></div></div></div><div><br></div><div>I also tried this piece of code, but "total_b" and "total_n" were still counted together:</div><div><div>If ((c.GetAttrib("Cue") = "E") And (currentresponse = ("n"))) Then </div><div>c.SetAttrib "total_n", count_n</div><div>Else If ((c.GetAttrib("Cue") = "E") And (currentresponse = ("b"))) Then </div><div>c.SetAttrib "total_b", count_b</div><div>End If</div><div>End If</div></div><div><br></div><div>Furthermore, when I try to present the separate counts in a text object at the end of each block by typing [total_b] and [total_n] Eprime says "no such attribute".</div><div><br></div><div>I hope this made some sense, but will answer any questions that you may have. Thanks a lot for any help. </div><div>Best,</div><div>Kelsey</div></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/dd2080cf-91a7-4c9c-ad4f-9050678d1a48%40googlegroups.com?hl=en-US">https://groups.google.com/d/msgid/e-prime/dd2080cf-91a7-4c9c-ad4f-9050678d1a48%40googlegroups.com?hl=en-US</a>.<br />
For more options, visit <a href="https://groups.google.com/groups/opt_out">https://groups.google.com/groups/opt_out</a>.<br />
 <br />
 <br />