Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

experiment variable is deleted when used.

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 sketchpad is called. Did you put your code in the Prepare tab (and not in the Run tab) of the inline_script preceding the sketchpad item? 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 var object like so:

    var.rest_block_time = 5
    


    Hope this helps!


    Cheers,


    Lotje

    Did you like my answer? Feel free to Buy Me A Coffee :)

  • gvhgvh
    edited February 2021

    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 Buy Me A Coffee :)

Sign In or Register to comment.