12-19-2012 04:49 AM - edited 12-19-2012 04:52 AM
I have an array of strings and I need to know the index of anything that is different of the string "off".
The function Search for 1D Array can return me only the index when find something, and not the index of the string that is different of this... Is there any function for that?
For example, I can have an array like (off, off, off, standard), and I need the index 3 for the string standard.
Thank you,
Thais
Solved! Go to Solution.
12-19-2012 05:08 AM
You could use the conditional loop terminal if you have LV2012.
(right click on the loop terminal > Tunnel mode > Conditional)
12-19-2012 05:11 AM
Just re-read the question and realised you want the index:
12-19-2012 05:19 AM
something like this should work
good luck
12-19-2012 05:54 AM
Hi,
how about this try..
12-19-2012 06:09 AM
You can still optimize (just for fun)
12-19-2012 10:53 AM
P@Anand wrote:
You can still optimize (just for fun)
Watch out, in your case selector Off use a capital "O".
Ben64
12-19-2012 10:58 AM
@ben64 wrote:
Watch out, in your case selector Off use a capital "O"
... unless the case is configured for "case insensitive match" 🙂
12-19-2012 11:02 AM
@altenbach wrote:
@ben64 wrote:
Watch out, in your case selector Off use a capital "O"
... unless the case is configured for "case insensitive match" 🙂
Thanks for the tip, actually I never realized this option exist.
Ben64
12-19-2012 11:22 AM - edited 12-19-2012 11:22 AM
And how exactly do you tell from looking at the code whether or not it is Case Insensitive? (In the snippet it is not. ). The answer is, you can't. It really cheeses me off when I have to resort to a right-click menu to determine how a piece of code is going to behave.
If it were me I would ditch that option. That might be too hardcore for some, so at least make it obvious via a glyph or something what the behavior is. I never use it, instead I drop a To Lower Case before the Selector.