| Reference | Downloads | Github

Can't exit loop

URL of project:

Description of the problem:

I am trying to end two loops at the end of the experiment by using the loop.finished = true; syntax. I have a counter which, when it reaches 8, should break out of the loops with the following code:

if(env_counter == 8)
    uber_order.finished = true;
    order.finished = true;

However, the loop continues. The counter appears to be working, because other routines are being initiated properly based on its number. I originally had this code in End Routine, but moved it to Each Frame in case that was the problem. Then, based on other answers to similar questions I tried ticking isTrials for both loops, but then it exits the loop after one iteration - I’m not sure why but either way this solution doesn’t seem to work for my case.

Any help would be greatly appreciated. The code in question comes in the ‘end’ routine at the end of the experiment. This should be the last hurdle before getting this task online!