LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

variable names in case structures

Hi there!
Is there a way to have my case structure check against *runtime variables* (as opposed to statically defined values). Think of:
* create case structure
* wire some integer variable to the Case Selector
* click Selector Label, enter name of some other integer variable

This yields an error, because LV interprets my other integer variable, puts it in quotation marks and thinks of it as a string. Is there any way to circumvent this?

Kind regards,
Severin
0 Kudos
Message 1 of 4
(2,580 Views)

Your query is a little unclear, I must admit

could you post a vi illustrating this error your observed??

Message Edited by devchander on 11-07-2006 04:18 AM

0 Kudos
Message 2 of 4
(2,575 Views)
Sure, sorry. Looks like this:
0 Kudos
Message 3 of 4
(2,567 Views)
OK, simple statement first:
Integer does not equal string.
You also seem to be tossing around "runtime" and "static" somewhat liberally. Once you wire an integer (be it a control or block diagram constant) to the case structure's selector, the cases can only take on integer values. This is by design. If you wire a string, the case items take on string values. If you wire an enum, the case items take on the enumeration values. Once you've defined a case structure's cases you can't change them at "runtime". This, by definition, is different code.

That said, it seems to me that you're looking for an enum.
0 Kudos
Message 4 of 4
(2,544 Views)