LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos
Philace

Multi input in case structure

It should be great if it as able to have more than 1 indicator for the condition case.

Today you need to do something like this

 LV_before.png

 

But this should be very cool !!

LV_after.png

7 Comments
crossrulz
Knight of NI

Please do a search before posting a new idea.

 

Duplicate: http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Allow-Multiple-Case-Selectors-along-with-shared-not-se...


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Philace
Member

I've already do a search yesterday but between my search and my post someone have the same idea

Norbert_B
Proven Zealot

Also, there are very rare cases where this makes sense. In common cases, you simply put some boolean logic to combine the selector inputs.

Another option next to boolean logic would be "encoding" in integers and use a multi-case case structure with appropriate case IDs.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Philace
Member

I don't think that its very rare and I already use an integer to run this type of problem but it's a bit restrictive to maintain or reuse and it is also a bit of a pain when there are more than 2 inputs. Moreover, it is less convenient to read, and this kind of functionality can be extended to other types of data.

 

Philace

AristosQueue (NI)
NI Employee (retired)

Please move this debate to the other thread... there are more comments there relevant to your conversation.

Norbert_B
Proven Zealot

Philace,

 

i am sorry to strictly contradict.

Either you have a strict separation of combinations (which would be the boolean logic/numeric solution as a SINGLE case structure) or you have case depending differences. So stacking case structures is a must for this.

 

As an example, we take two boolean criteria A and B. In case we differ between all combinations, we would have:

AB

A!B

!AB

!A!B

Four well defined cases with DIFFERENT code. In this case, the solution is to use a numeric and "encode" the boolean values. It is clean and expandable for additional boolean criteria easily.

If B is only relevant for A, it would be:

AB

A!B

!A

So we got three cases, not four. So in this case, stacking case structures is the proper approach as the difference of B and !B depends on A, but it refers to different code execution depending on B or !B.

 

So there is NO use case where your feature request is required. In most cases, there is imho a cleaner, more expandible way to address this, which (granted) requires the developer to clearly think about what he wants to do.

I understand the request as is, so please don't mistake me here. But i think that the gain of comfort is not worth the effort to implement it and it could easily create misunderstandings and wrong coding for non-experienced developers.

 

BTW: How many selectors would you consider appropriate? Two, as your screenshots indicate? Four? Twenty?

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Darren
Proven Zealot