It might be silly question, but I encounter issue with set/reset the boolean bit in perspective scripting.
for example, I want to use toggle button template.
in a new view, I created the following params
then in the button event, i have the following script. self.view.params.tagValue = not self.view.params.tagValue
it works.
But if I change to the following script, it won’t work. It looks like the value has been changed to string type.
If I change it to the following scripting, it does not even pass the syntax check.
If I change it to the following, the datatype is changed to numeric, still not working.
How do I assign boolean data value in perspective script?
It also happened when I read/write the PLC boolean data type, I need to use data transform to transform “true/false” to “0/1” before I can read the value correctly on the view.
Did I missed something? Or is there any way to fix the perspective params to certain data type?
Tip: use the </> code formatting button to preserve code indentation and apply syntax highlighting. It’s essential for Python and makes any code much easier to read. There’s an edit button (pencil icon) below your post so you can fix it.
No winning there. The property editor displays JSON. Java and Javascript (and thus JSON, Javascript Object Notation) use true and false. No matter what we pick, it's going to confuse someone.
You seem to have applied it line by line which results in a each line enclosed in single backticks. Select a whole block of code and press the </> button. You should get a result like