05-23-2016 04:40 AM
Hello to you all!
I've noticed strange (for me) behaviour of Scan from string function.
If I want to use it to read from string, but instead writing format string (%s %d %b (...) ) I want to declare type by connecting specific type corresponding to input.
And when it comes to reading strings or digital - there's no problem, but with booleans for some reason, the function does not interpret 0 as False and 1 as true. If I connect the String Format with %b - it works fine...
Here's the snipped:
Is this a bug or known thing?
PS: apologies for my English - it's my 2nd language...
Solved! Go to Solution.
05-23-2016 06:22 AM
0 and 1 is the binary representation of the boolean type. If you open the help file on a boolean control you will see that the the boolean type value are TRUE, FALSE. If your string contain TRUE, FALSE, T, F, True, False for examples it will be recognize as a boolean.
In your case if you don't want to use a format string you can use a U8 constant and use Not equal to zero.
Ben64
05-23-2016 07:49 AM
Oh... I see. Thank you for explanation.
However I still think using 0 and 1 should be also considered for boolean type use;)