Boolean Value in Variable Set for Release 0.7
Hi Chris,
We notice that if a variable set is loaded, the boolean value can change from "True/False" to numeric numbers 0/1 in the variable display window. It would be nice if the boolean value can be consistent.
Thanks,
Ziye
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Christopher Sta... on 18 Jan, 2017 02:46 PM
Hi Ziye,
I am not able to reproduce the problem you describe. Can you send me a copy of the variable set XML file that you're using? You can find the file in
Also, what is the name of the variable whose displayed value is changing?
Thanks,
Chris
2 Posted by Ziye Xu on 18 Jan, 2017 06:55 PM
Hi Chris,
Both the experiment and variable are attached.
Thanks,
Ziye
Support Staff 3 Posted by Christopher Sta... on 18 Jan, 2017 08:22 PM
Hi Ziye,
Thanks for the files. Can you tell me the name of a variable whose value you've seen switch from true/false to 0/1?
Thanks,
Chris
4 Posted by Ziye Xu on 18 Jan, 2017 08:58 PM
For example, "doOnlyMaxDiff" is defined as Boolean in experiment file but in the saved variable xml, it's integer. I think that's why it showed up as 0/1 after loading. It's not clear to me why it was saved as different data type. When I tried to make it as True/False in variable display window, it would still be numeric. It seems the only way to do it is to change the variable set xml file in text editor.
Support Staff 5 Posted by Christopher Sta... on 19 Jan, 2017 03:56 PM
Hi Ziye,
Thanks for the additional info.
Yes, that's correct.
More specifically, if you try to change 0 to false or 1 to true, the value will still be numeric. However, if you change 0 to true or 1 to false, then the value will become boolean.
The reason for this is that, before assigning a newly-entered value to a variable, the variables window first checks whether the new value is equal to the old value. If it is, then no assignment is made. In MWorks' view, true is equal to 1 (and false to 0), so attempting to replace the former with the latter results in no change. However, if you first change 1 to false, and then change false to true, the final value will be boolean.
I see how this behavior can be confusing and/or annoying. It should be pretty straightforward to fix. I'll add it to my to-do list.
Cheers,
Chris
Christopher Stawarz closed this discussion on 31 Jan, 2017 03:37 PM.
Support Staff 6 Posted by Christopher Sta... on 11 Sep, 2017 03:00 PM
Hi Ziye,
This issue is fixed in the current MWorks nightly build. In the variables window, you can now change 0 to true or 1 to false, and the type change will persist.
Cheers,
Chris
Christopher Stawarz closed this discussion on 18 Sep, 2017 01:58 PM.