String to Integer variable
in OpenSesame
Hi everyone, me and my group are building an experiment on OpenSesame but we're new to it. We need to use an input from the subject and sum it to some other values we have. The problem we're having is that, using a "form text input", the input number is treated as a string and we don't understand how to change it to Int(). Looking at the documentation, the input key should be automatically treated as an integer or a float when only numeric keys are used.
Any help will be appreciated!
Comments
Hi,
I don't know how forms are supposed to behave and whether the strings remaining a string is weird or not, but you could use inline_script to fix that. So, place an inline_script in the trial sequence after the form and put in the run phase, some code like this: `var.text_input = int(var.text_input)`. As you said , normally this should be done automatically, but maybe forms are a bit different.
If this doesn't work, would you upload the experiment here? Then i could have a look.
Thanks,
Eduard