experiment variable is deleted when used.
in OpenSesame
Helly everybody,
I tried to define a variable that I will use throughout my experiment for defining the time a stimulus is shown.
The way I do this is by placing an inline script at the start of my experiment, in which I run the following code:
and on a sketchpad I do the following:
But when I try to run my experiment I get the following error:
and when I look at the variable inspector I see the following:
The strange thing however is that when I do not use the variable (set the duration to some number), the variable can be seen:
What is happening and how can I solve this?
Thanks in advance!
Comments
Hi @gvh,
A first thing that comes to mind is that the variable is not yet set at the moment the
sketchpadis called. Did you put your code in thePrepare tab(and not in theRun tab) of theinline_scriptpreceding thesketchpaditem? If this doesn't solve the issue, could you upload the experiment here?Btw, in newer versions of OpenSesame the regular way to set variables is by using the
varobject like so:Hope this helps!
Cheers,
Lotje
Did you like my answer? Feel free to

Dear @Lotje,
That did the trick, thank you! I'm a bit embarrassed that I did not think of this myself...
With regards, Gert
Ah, great to hear and thanks for sharing the solution :)
Did you like my answer? Feel free to
