LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

scan from string with TRUE FALSE and comma as separator

Solved!
Go to solution

Wiring "TRUE FALSE" as input and "%s %s" as format as well as false constants to scan from string produces

the desired two binary values corresponding to the string input.

Whereas "TRUE,FALSE" as input and "%s,%s" as format leads to an error.

I wasted much time to figure out that the error has its origin in the incompatible separator and not in the way i use this function.

Would it be possible (asking kindly) to place a remark in the online help for this function that you should only use spaces or tabs as separators
with binary strings when using this function?

It was not obvious to me why i shouldn't use comma as separator.

My workaround now is to replace all commas by spaces before wiring the input string to scan from string.

Is there another workaround or does somebody can provide a more deep understanding of why comma doesn't work?

My guess is, that it's confused with a decimal separator and therefore assumed not beeing part of a binary value.

 

 

0 Kudos
Message 1 of 2
(3,815 Views)
Solution
Accepted by Labuser16383

Use "%[^,],%s" as your specifier.  "%[^,]" will result in a string until the next comma.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 2
(3,802 Views)