I have no better way of doing this, but I'll give you my opinion as to the
readability and the maintainability.
Readability:
I find option 2 more readable, the entire code is laid out and easy to
see without cycling through cases. It is pretty easy to see what it does
and how it works. Option 1 requires a little more thinking to follow the
logic, but is not undecipherable.
Maintainability:
I would think that option 1 is much more maintainable. Simply add
another case to the case structure and you're ready to go. No rewiring, no
need to clear out more room on the diagram. Seems easy to me. Option 2 is
going to require a little more work, and if room is already scarce on the
diagram, adding another case structure may make wiring more
difficult.
Overall:
I'm not sure I see where I would incorporate this in my code right now,
but if the need arose, I would probably do something like Option 1.
My thoughts
Spencer Anderson
"Jabberwocky" wrote in message
news:506500000005000000BC5D0000-1012609683000@exchange.ni.com...
> That does mimic my string example, but it doesn't solve the general
> situation. The switch in C is exactly like LabVIEW's Case Structure,
> but with one interesting property: you can set it up so that whichever
> case executes first, all cases after that will also execute. This is
> frequently useful when you have several values that need various
> amounts of work done and those work quantities are subsets of each
> other. The LV case structure only executes one frame of the structure.
> It would be pretty tricky, given the nature of dataflow, for NI to
> build a structure that can "fall through" the way C's switch can.
> That's why I was designing groups of structures that have th
is
> behavior. The two I showed in my original post are the only ones I
> have been able to come up with thus far.