Howdy, Stranger!

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

Supported by

[solved] Numerical variable values

edited November 2012 in OpenSesame

A short question: how do I stop OS from auto-correction my "0010" variable values to "1"? I've tried writing it directly in the script editor, but when I test the experiment, some variables will again have been corrected as above.

Best regards,
Jákup

Comments

  • ITA

    We will come back to you as soon as possible.

  • Hi Jakúp,

    OpenSesame interprets values in the simplest possible way:

    • Firstly, if the value could be treated as an integer (the most simple type), OpenSesame does so.
    • Secondly, if the value cannot be an integer, but it could be a floating point, it is treated as such.
    • Finally, if the value could neither be an integer nor a floating point, it is treated as a string (the most complex type).

    Because in Python

    print int("0010")

    gives
    10

    OpenSesame interprets "0010" as "10".

    What do you need the "0010" values for? Is it possible to, for example, simply rename them to "_0010"? By doing so they will be interpreted as strings rather than integers.

    I hope this helps!

    Best wishes,

    Lotje

  • edited 2:22AM

    Hello Lotje.
    Thank you very much for your clarification!
    I needed them for presenting stimuli in the form of 100+ images, with numerical file names, but solved it, as you've suggested by naming the variables for example ".0010."

    Best regards,
    Jákup

Sign In or Register to comment.