03-11-2014 01:11 AM
Hi all
I have 3 numerical input variables. I have to check wheather the individual variables lie in a particular range. After getting yes or no confirmation of the 3 variables,based on the resulting condition a particular message will be displayed. There are atleast 6 different cases and messages to be displayed.
please help me with a way to proceed into this.
can i have i case structure with all the outputs in it to display for the different cases...but how can i give the case selector then?
thank you !!![]()
Solved! Go to Solution.
03-11-2014 01:39 AM - edited 03-11-2014 01:40 AM
Just wire the array of three element to "in range and coerce" and set the comparison limits (either scalar or arrays of three elements). You'll get an arry of three booleans. Convert that array to an integer using "boolean array to number". Use the number to index into an arry of possible messages.
If you need more detailed code, wire the integer to a case selector and create cases for each possible value.
03-11-2014 02:33 AM
thank you sir..
but the ranges also changes. so i'll have to use more than one 'in range' . then to use case structure to display different messages, the input for different cases will be coming from more than one 'in range'...or i'll have to use multiple case selectors
03-11-2014 02:41 AM
6hari9 wrote:but the ranges also changes. so i'll have to use more than one 'in range' . then to use case structure to display different messages, the input for different cases will be coming from more than one 'in range'...or i'll have to use multiple case selectors
Why? If you feed an array of three elements, and use arrays of three elements for the lower and upper limits, you should be all set. The comparisons will be element by element. You get a boolean array out, one for each af the three comparisons.
If the three values are scalar, built them into an array first.
03-11-2014 03:18 AM
thank you sir
I hadnt considered of giving array values to range.. ![]()