psychopy.org | Reference | Downloads | Github

Default value of selectedRows for a loop

OS (e.g. Win10): Win 10
PsychoPy version (e.g. 1.84.x): v2020.1.1
Standard Standalone? (y/n) If not then what?: y
What are you trying to achieve?: I would like to set a variable nTrials that determines whether a loop runs for a fixed number of trials (nTrials = “0:5”, with $nTrials in Selected Rows attribute of the loop) or fully. Although I can set the former, I do not know what value to assign to nTrials variable to let the loop run fully, if I do not wish to hard-code the size of the loop (e.g., nTrials = “0:1000”). In other words, what is the default value of the “Selected Rows” attribute that would allow me to run the loop in its entirety?
My understanding is that, if the loop needs to be run fully, the Selected Rows attribute is not specified at all. If this is the case, then hard-coding the size of the loop (e.g., nTrials = “0:1000”) might be the only option.

Thanks for your help.

I would guess you would just pass an empty string.

Hi Michael, I did try that ("") . Doesn’t work. Loop terminates after one trial.

I guess if you put something like "" in a conditions file, it might be passed as the literal string '""', and thus not actually be empty. If you are doing this via a conditions file, try using just a blank cell, or the letters None (with no quotes). The code is set up to deal with these various options:

If you still have the problem, please provide any error message, if one occurs.