How can I know which type of loop is in progress

Hi :grinning:
I’m writing a program similar to delayed match-to-sample task.
In my program, there is a Conditions file called “matchingConditions” and inside there’s one column that’s called “matchOrUnmatch”, with only two variables: “matched” and “unmatched” (If the two pictures I will add in routine are the same or not).

I’m trying to write a code in a Code Component so I can know which type of loop is currently in progress (“matched” or “unmatched”).
At first, I tried to write: if matchOrUnmatch == unmatched, or: if currentLoop == unmatched, but not matter what - I got a syntax error.
I know I’m missing out something, and I would be glad to get some help.

Thank you!

Hello Ido1122

please post your code here surrounded by triple ` to get the proper formatting.

Best wishes Jens

Hey,
I’ve actually managed to solve it by myself.
Thank you for your time! :grinning:

For future purposes, I used the method: matchingTrials.getCurrentTrial() (change matchingTrials into your Loop name). Then you can get the Condition name of the Parameter of your current Loop.
By the way, in order to avoid some errors, it’s not originally a string variable, but you can easily convert it into one.