i have 3 routines (trial, trial2, and trial3) in my experiment that are all reading from the same excel file. The goal is that after the myCount variable reaches 3, it should continue to the next routine in the experiment. I tried to end the current routine (so that it would continue with the next routine in the experiment (trial2), however when i use the code below (continueRoutine=False), the experiment gets stuck on the current routine screen. i also tried to end the loop around the routine using trials.finished= True, however this does not seem to work. To summarize: i just need the current routine to end after it reached myCount >3, and to continue with the next routine (trial2)
The code I am using:
myCount = 0
myCount = myCount+1
if MyCount > 3:
Any reason you typed
whoops typo on my part, i used continueRoutine without the period and ran into the above error
This happens when you run the experiment offline or online? Actually, this code should work. So I assume that something else is preventing your experiment from working. What happens if you remove this code from your experiment? Does it run?
Best wishes Jens
This seemed to be the issue. I changed the code and now the loop breaks once the counter is reached. The only thing is that I am getting a number additional lines included in the CSV for every repetition of the master loop. in other words, when a routine is skipped (supposed to occur with the code i am using), the skipped routines + their stimuli still show in the CSV. Are you familiar with a way to get rid of these lines since the routines/ stimuli were not presented?
is the Is trial box checked? If so uncheck it. If you want the master loop to end when the counter is reached, you could add
LOOP.finished = True
Replace LOOP with name of the loop that you want to finish.
Best wishes Jens
unchecking the trial box did the trick, thank you!