|
|||||||||||||
For some reason I was certain this was already in the idea exchange, but I couldn't find it -- so I'll post it.
Select Case structures are frustratingly difficult to use if you want one case to support multiple values.
In text languages you can often do something like
Switch (Foo) {
Case 1:
execute this code;
Case 2:
execute this code;
Case 3:
Case 4:
Case 5:
execute this code;
Case 6:
execute this code;
Default:
execute this code;
}
Notice that the case for 3,4,5 is all the same, and I just need to put it in place once.
TestStand can't do this. You need to do something like this:
how to do select case on multiple values
which is horribly difficult to write, maintain, and understand what is happening. It would be MUCH easier if select case on multiple values worked like this:
where it looks just like other text based languages, although it takes up quite a bit of realestate on the screen.
or maybe something like this:
where I can just type in a comma separated list of allowed values. The similarity with text based languages disappears here, but it is much smaller on screen (but notice how it shows nicely in the description field) and lines up better with LabVIEW notation.
Note: LabVIEW already supports doing this, and also supports ranges of values (eg 3, 5..10, 12 for numerics) which would also be nice, and also supports case sensitive and insensitive comparison for cases.
I propose using an array where if the value matches any value in the array then the case executes. Additional text "pass array to match multiple values" would be added to the dialog/step pane.
There is already precident for this behavior in TestStand steps.
I think this would work better than a comma separated list, because commas already have a different meaning in a TestStand expression.
You must be a registered user to add a comment here. If you've already registered, please log in. If you haven't registered yet, please register and log in.
Post New Idea to submit a product idea. Be sure to submit a separate post for each idea. Note: the TestStand Idea Exchange is not the appropriate forum to submit technical support questions.The TestStand R&D team is committed to reviewing every idea submitted via the TestStand Idea Exchange. However, we cannot guarantee the implementation of any TestStand Idea Exchange submission until further documented.
My Profile | Privacy |
Legal |
Contact NI
© 2011 National Instruments Corporation. All rights reserved. | E-Mail this Page
|
||

E-Mail this Page