LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why can't I make a boolean case default?


@altenbach wrote:

@billko wrote:
I will usually explicitly name the items going into that common state.

Try that with a case structure wired to the "event type" event data node. You might need a bigger monitor!

 

As an example, I have an event case with dozens of "value change" and other types, but need to only handle a double-click on a listbox differently, i.e. having a case structure with "listbox double click" and "default" as the only two cases. (as used in this program)

 

(Yes, this is slightly different because we have no control over the items. but you might see my point. Without a default case, everything would break if NI decides to add a new event type in 2050 :D)

 

altenbach_2-1625063922838.png

 

 

(Image truncated. the list is much longer!)

 

 

 


That's not very convenient, is it!  😄

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 11 of 13
(755 Views)

I'd like to see more code from the OP.  

 

As a general rule True False case selectors are often drivin by a comparison.   At which point there are 2 cases and the comparison is likely to be useless if a default case is used. (The equivalent of an iff)


"Should be" isn't "Is" -Jay
Message 12 of 13
(752 Views)

@JÞB wrote:

I'd like to see more code from the OP.  


Yes, we can continue to guess. Unless the OP gives more details, we can assume that learning has already taken place and things have become clear. (... or they have decided that programming is not for them :D)

 

(Another possibility interpretation could be that the OP is actually thinking of output tunnels that are set to "use default if unwired". These are of course allowed in boolean case structures.)

0 Kudos
Message 13 of 13
(715 Views)