Conditionally skip code routine based on block

I have two routines that each contain their own code component:

Screen Shot 2022-09-26 at 5.35.35 PM

During my welcome screen, I create a variable ‘Block’ which is determined by generating a random number:

Screen Shot 2022-09-26 at 5.34.38 PM

What I am trying to do is only run one of the code routines (‘negCode’ or ‘posCode’) conditionally based on which group is assigned at the beginning of the experiment:

I’ve tried using ‘continueRoutine = False’ to conditionally run one of the two, in both Begin Routine and Each Frame, but that doesn’t do anything.

Hoping someone has a suggestion for a possible solution. Please let me know if you need more information.

Is it important to you experiment that both of these code components are in their own routine? If not, you could simply copy-paste the code of these components into the if-statement itself.

Otherwise you could preface both code components in their separate routines with an if-statement.

That worked perfectly, thank you!