cancel
Showing results for 
Search instead for 
Did you mean: 

Case insensitive "Scan from string function"

Jan_HeG
Member

Case insensitive "Scan from string function"

Message contains an image

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)

4 REPLIES 4
Norbert_B
Proven Zealot

Re: Case insensitive "Scan from string function"

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.
Spectre_Dave
Active Participant

Re: Case insensitive "Scan from string function"

Message contains a hyperlink Message contains an attachment

 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
Highlighted
Jan_HeG
Member

Re: Case insensitive "Scan from string function"

Message contains a hyperlink

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
Neil.Pate
Active Participant

Re: Case insensitive "Scan from string function"

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