LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Case insensitive "Scan from string function"

Hello!

 

I am sure this is a simple thing to answer, but Labview help files and searches here have not given me any results, so I hope someone here can.

 

Is there any way I can make the "Scan from string function" case insensitive?

Scan from string.png 

As illustrated above the code in the "no error" case will work as expected, however the code in the "error" case will not convert the string to the correct case, as the "A" is capitalized in the enum. 

 

As the string I am converting will come from end-user input I would like this to be case insensitive. 

 

So, thats the back story; Now for the question: Is it possible to use parameters in the "format string" input to make the scan case insensitive or do I have to add additional code? (i.e make the enum lower case, then use the "to lower case" conversion bullet)

0 Kudos
Message 1 of 5
(3,031 Views)

No, you cannot change "Scan from String" to be case insensitive; at least i am not aware of....

What do you think about capitalize (To upper case) or lowercase (to lower case) all symbols before scanning? 

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 5
(3,020 Views)

 see that your Enum is Title case - you could convert the incoming string to Title.

 

Convert to TitleI

Message Edited by VADave on 07-15-2009 08:21 AM
Message Edited by VADave on 07-15-2009 08:22 AM
Visualize the Solution

CLA

LabVIEW, LabVIEW FPGA
0 Kudos
Message 3 of 5
(3,011 Views)

Aw...

 

Reading manuals: 10 minutes

Searching forum:  10 minutes

Writing a forum post: 15 minutes

 

...

 

Solving the problem with a workaround: 5 minutes  

 

Smiley SurprisedSmiley Very Happy 

 

// edit:

 

VADave: A possibilty, but just to make this complicated I have "OK" in my enum as well. Writing a case to handle "OK", "Ok" and "ok" is just.. not ok.

Message Edited by Jan_HeG on 07-15-2009 08:29 AM
0 Kudos
Message 4 of 5
(3,003 Views)

Jan,

 

If your string is coming from user input, its probably not a good idea to directly try and convert it to an enum, there are going to be too many weird combinations that you will have to filter out.

 

N

0 Kudos
Message 5 of 5
(2,997 Views)