LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can someone get me this comparisson functionality in a more simple way

Thanks in advance

 

Untitled.png

 

 

Edit: hahaha remove the select. Long week...

0 Kudos
Message 1 of 7
(3,012 Views)

Hmm... I'm not quite sure what you're asking.  The value of that whole thing is always true, so you could just replace all of it with a simple "T" boolean constant.

 

Are any of the constants shown there going to change?

0 Kudos
Message 2 of 7
(3,003 Views)

@LandJBelenky wrote:

Hmm... I'm not quite sure what you're asking.  The value of that whole thing is always true, so you could just replace all of it with a simple "T" boolean constant.

 

Are any of the constants shown there going to change?


Yes...this was just an example...

0 Kudos
Message 3 of 7
(3,001 Views)

 

I guess I would do it this way.  I normally don't like Case Structures very much because they're large and they don't let you see all of your code at the same time, but in this case, it seems appropriate.

 

String Type.png

 

Why do you only want to use the 3rd and 4th character (the "ri") in the comparison?

0 Kudos
Message 4 of 7
(2,998 Views)

You might try this to avoid the string manipulation if the equality check fails:

 

Example_VI_BD.png

 

Is your goal to improve efficiency or just make it prettier?

 

My thought is that comparing things outside of the Case selector is silly, but you said that all of those things could change.  If "Type" was permanent it might be faster to do as LandJBelenky did above, but I don't know.  I've read a thread that shows how Case structures slow down with more comparisons and that ordering cases (order of likely match) can help.  I'm curious to see how others will approach this.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 5 of 7
(2,971 Views)

It was just to make it prettier. Efficiency isn't an issue here. I just had a Friday brainfart.

0 Kudos
Message 6 of 7
(2,948 Views)

@LandJBelenky wrote:

 

Why do you only want to use the 3rd and 4th character (the "ri") in the comparison?


It's a subset of a string which contains concatentated information that I am keying off of. Those are the particular characters I care about in this instance.

0 Kudos
Message 7 of 7
(2,945 Views)