Hi Everyone, I am trying to run a procedure in which participants respond to a stimulus during a practice trial, and then again during an experimental trial. In the latter, I want the duration of this stimulus object to be determined by participants' average RT to it in the practice. I have managed to do this using the code below, but when I try and extend it into another context (i.e. use the same "MeanPracticeReactionTime"attribute in a new inline, within a new procedure), it is not working. Can anyone see where I am going wrong?
Thanks in advance!
'User Tab:
Dim g_nTotalTrialCount As Integer
Dim g_TotalPracticeRT As Integer
Dim g_MeanPracticeRT As Integer
'Inline 1:
g_nTotalTrialCount = 0
g_TotalPracticeRT = 0
g_MeanPracticeRT = 0
'Inline to update Trial count
g_nTotalTrialCount = g_nTotalTrialCount + 1
c.SetAttrib "TrialCount", g_nTotalTrialCount
'Inline to calculate average RT:
g_TotalPracticeRT = g_TotalPracticeRT + PracProbe2.RT
c.SetAttrib "TotalPracticeRT", g_TotalPracticeRT
g_MeanPracticeRT = g_TotalPracticeRT / g_nTotalTrialCount
c.SetAttrib "MeanPracticeRT", g_MeanPracticeRT
'Inline to set Stimulus Duration to average RT from the previous procedure:
c.SetAttrib "MeanPracticeReactionTime", g_MeanPracticeRT