| Reference | Downloads | Github

Variable not defined despite being there

If this template helps then use it. If not then just delete and start from scratch.

OS (e.g. Win10):
PsychoPy version (e.g. 2021.2.3x):
Standard Standalone? (y)
What are you trying to achieve?:

I am simply trying to get a text variable to appear on screen, and be moved on by a space bar press. My text is contained in a .csv in the same directory as the .psyexp file, and has two columns , one, “instructions_text” contains experimental instructions, and the other “slide_counter” contains text for a slide counter.

What did you try to make it work?:

In my loop I have put my instructions.csv file. In the text component in the routine itself I have written $instructions_text. My loop is sequential.

What specifically went wrong when you tried that?:

When I try to pilot my experiment on Pavlovia, I immediately get the message that the instructions_text variable is not defined. I have looked in the JS and Python code and the instructions.csv is getting recognised at the start.

Any help would be greatly appreciated.

Hi there, would you mind sharing your experiment with me? Sometimes it could just be a typo or an extra space somewhere that’s causing that error

Hi, yes you can find it here Pavlovia

I have made it public so you can see it,


I checked and currently $instructions_text is set to “constant”. You need to set it to “set every repeat” from the drop down. That should hopefully fix it.

1 Like

Thank you very much mate - I’m still unsure of the difference between constant and set every repeat, so I need to familiarise myself a bit more. Thanks again!