| Reference | Downloads | Github

Inner loop termination causing outer loop to terminate

So I started trying to terminate the inner loop by using the code,

myloop.finished = true;

It caused the outer loops to terminate instead, so I looked in and instead added the code:

trials.finished = true;
continueRoutine = false;

This gives the error that both trials is undefined and so is continueRoutine. I have 3 loops that hold about 5-6 components, I am unsure if this is due to having so many loops.

The first error would indicate that you are referring to the trials loop at a point when it has not yet been created. The second doesn’t really make much sense, as you are defining the variable at that stage.

So I’d suggest you need to give the full error messages, and indicate where this custom code is placed.

Hmmm… I am not sure what you mean.

I am mostly referring to this bug:

My trials.finished = true; replacement for my previous code (myloop.finished = true;) does not terminate the inner loop and only says it is undefined, although it was placed in a code snippet at the start of the loop.

Anyone have any ideas?

Please could you show screen shots of your flow and code routines?


Should have both in it, thanks!

total_score is a strange variable to vary frame by frame

It was mostly to check if it is less than 1, and I had it on the Begin Routine part. The issue is that it didn’t work, so I thought I had to put it in the Each Frame tab.

I’ve just spotted that you have countineRoutine not continueRoutine

1 Like