BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Should Case Structures be replaced with..... Stacked Sequences!!!???!!

 

I was editing an example and right clicked the Case Structure... to my surprise, LabVIEW 2010 offered a suggestion to replace it with a Stacked Sequence Structure...

 

Is this a good idea?

 

Many already know my answer... But what do others think?

 

 

0 Kudos
Message 1 of 15
(11,314 Views)

I agree that this is one of the most useless functions and I believe I pointed that out before several times. 🙂 (It probably goes all the way back to prehistoric LabVIEW versions).

 

More useful would be to convert between case and event structures, but it does not seem to be a very popular idea. 😞

 

(So... two ideas that need more votes!!!!)

0 Kudos
Message 2 of 15
(11,308 Views)

I have not yet voted on your idea.  It is certainly much better than converting to Stacked Sequence Structures.

 

I think the difficulty is the caveat that you pointed out in your idea thread.  It cannot create event assignments...  Which is the one issue holding me back from a vote...  Maybe we can explore an alternative..  An suggest a change to the menu.. Or at least remove the Stacked Sequence from the selections.

0 Kudos
Message 3 of 15
(11,303 Views)

I edited my comment and added another link.

 

It seems since the inception of LabVIEW, there actually was a single person that used that option once according to the first reply. 😄

Maybe it's not totally useless after alll  😮 ...NOT!!!!

0 Kudos
Message 4 of 15
(11,300 Views)

You got Kudoed..

 

I guess I am not the only one who thinks it is an idea that should be implemented.

0 Kudos
Message 5 of 15
(11,283 Views)

I kudoed Christian's idea about 2 years ago. So I'm with you !

0 Kudos
Message 6 of 15
(11,266 Views)

I just kudoed it but am having second thoughts after reading Aristos's comment. I have never needed that and didn't know it was possible. But I sometimes inherit code written by others and the more refactoring tools the better.

 

A better idea would be if the convert case structure to stacked sequence structure poped up a dialog asking why and posted the answer here.  Smiley Very Happy

=====================
LabVIEW 2012


0 Kudos
Message 7 of 15
(11,233 Views)

A case structure is so fundamentally different from a stacked sequence structure that I have a hard time even imagining why we need to switch between them.

 

Sure, converting from a sequence to a case structure help in re-architecting a program to a state machine, but it typically cannot be cleanly done, for example because all sequence locals will disappear, potentially breaking a lot of code and making a tangled mess.

 

Converting from a case structure to a stacked sequence is really not needed, because the same functionality can be achieved by wrapping a FOR loop and wiring [i] to the case selector. This leaves the option open for a more full featured state machine in the future. Converting someting like this to a stacked sequence just because the cases execute in sequence is not reason enough to change it to a stacked sequence. There is no advantage! All we would do is painting outselves into a corner and making the existing code less flexible and less maintainable.

Message 8 of 15
(11,230 Views)

I totally agree and would be hard pressed to find a use for converting a case structure into a stacked sequence. The other way yes definately.

 

But it came in handy one time for one person. Since that will probably never happen again I am leaving my kudo on the idea Smiley Happy

=====================
LabVIEW 2012


0 Kudos
Message 9 of 15
(11,226 Views)

I totally agree with Christian.

 

The only case structure that would translate into a Stacked Sequence would be one that is indexed fromletys say 0 to n.  But why would anyone ever want to do something silly like that?  It's like taking a round wheel and making it square..!!!

 

D'euh!!  (sarcasm intended)

 

 

0 Kudos
Message 10 of 15
(11,219 Views)