invalid syntax
I have been working on debugging this for a while now. I am new to code, so I may be missing something simple.. Here is the message I am getting when I run the experiment. I highlighted all the things that OpenSesame put in red.
File "C:\Users\jonesfm\Desktop\OpenSesame\lib\site-packages\libopensesame\inline_script.py", line 73, in prepare
self.var.get(u'_run', _eval=False))
File "C:\Users\jonesfm\Desktop\OpenSesame\lib\site-packages\libopensesame\python_workspace.py", line 147, in _compile
return compile(script, u'', u'exec')
File "", line 4
else var.valid_pos = 'false'
^
SyntaxError: invalid syntax
Thank you!

Comments
if this helps, this is my inlineScript:
if var.box_pos == var.arrow_cue:
var.valid_pos = 'true'
else var.valid_pos = 'false'
if var.box_pos != var.arrow_cue:
var.invalid_pos = 'true'
else var.invalid_pos = 'false'
it might be a problem that I do not have anything in the "prepare" window. I only have it in the "run" window... What should go in the "prepare" tab?
Hi,
It's never too late to start learning how to code. There are plenty of nice Python tutorials online.
Your mistake, is that you don't adhere to Python's indentation rules and that and
elseis always followed by acolon. Also, your code is a little convoluted. I simplified it a little, can you see the difference? This is how it should look:As a side note, if you want to use booleans (True, False and such), you have to use
TrueandFalseand not the stringtrueandfalse.Eduard
that worked perfectly! Many many thanks!