01-15-2008 12:13 PM
01-15-2008 12:35 PM
01-15-2008 12:44 PM
01-15-2008 12:50 PM
@tst wrote:
Instead of changing the array to a number, use a Search 1D Array on it and search for the T value. Wire the resulting index into your case structure.
01-15-2008 01:13 PM - edited 01-15-2008 01:14 PM
" Is there some reason someone normally wouldn't want to do this?"
None that I know of.
Have you tried right-click on the case and changing the radix?
Ben
01-15-2008 01:21 PM
01-15-2008 01:33 PM
@aeastet wrote:
There are much more eligant and efficent ways to better flow control and manage your data than just attaching a number to a case. Something that you will probably learn or develop as we did over time depending on how much programming that you do.
01-15-2008 01:37 PM
01-15-2008 01:58 PM
01-15-2008 02:08 PM
There are certainly other ways things can be done (enums, as the original poster mentioned, LV classes with dynamic dispatch, variants, queued state machines, etc.), but there are place where simple solutions like this are also possible.
One example that comes to mind is when I have a few similar controls that all call the same piece of code, but each with an added piece of code of its own. I could write an event case for each and then go to a single state in a state machine or an event handler, or I could move the shared piece of code into a subVI, but it's much easier to build them or their references into an array and use that to find out which control was the one which was changed.