LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Scan From String Into Enum -- Exact Match Otherwise Error


@Darren wrote:

Here's another silly way to do it:


s.png


For the price of one less VI 😉 

0 Kudos
Message 11 of 12
(1,160 Views)

@GregFreeman wrote:

What if I meant to type "ThisIsn't" as my string but i missed a couple characters. I'll get a match and it will be for the wrong item, when what I really want is it to match neither item. 

 

Here is the problem: what if I ordered my enum differently so "ThisIsn't" was first. Then scan from string would return that item. Reordering my enum could completely change the functionality of my program. 

 

scan.png


Yeah, that is an issue, and a troublesome one.  Would be nice to have an exact string and perhaps case insensitive format specifier, something like %+s matches exact string and %-s ignores case. (I selected + and - since they are already used for numeric specifiers, so are normally used already)

Jon D
Certified LabVIEW Developer.
0 Kudos
Message 12 of 12
(1,148 Views)