LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

%[A-Za-z]

Solved!
Go to solution

Can someone tell me the operational difference between %s and %[A-Za-z]?? I have an instance where the first field in line of data is a capital letter. The %s identifier caused an error from the Scan form string vi. My vi is working but it would be helpful to know why one worked and the other did not. Thanks in advance.

 

ssmith(Scott)

0 Kudos
Message 1 of 3
(3,286 Views)
Solution
Accepted by topic author ssmith490D

Well, the direct answer to your question is in the Help file:

  • s—String (for example, abc). When scanning, s matches only up to the next white-space character. A space matches one or more consecutive white-space characters. To scan a string that may contain white space, use the characters in set conversion code. Specify all the characters which the string may contain within the brackets, including space or other white-space characters.
  • [ ]—Characters in set. [ ] matches a string that contains only the characters specified between the brackets. Character matches are case sensitive. The [ ] conversion code is useful only when you are scanning strings. To match the caret symbol (^) in a set, make sure it is not the first character after the bracket.

What does your input string look like?

 

Message 2 of 3
(3,281 Views)

Thanks for the help. The difference is that the %s scans up to white space, My input is comma delimited without any white space. The %s scan, scanned until the first CR, which was 7 fields of data. Thanks again for the help.

 

ssmith

0 Kudos
Message 3 of 3
(3,248 Views)