05-15-2025 10:35 PM
I currently have 3 different boolean values being produced by my program. At any 1 time, only 1 of them is equal to 1 and the others are equal to 0. I want to have a case statement which I can use to create a different numeric value based on which boolean value is equal to 1. How can I differentiate between the boolean values in order to use them in my case structure?
Note: Once i have the right case selected the number will be sent to RobotStudio.
05-15-2025 10:47 PM - edited 05-15-2025 10:58 PM
Try this snippet:
or this one if you're feeling mathy:
Here's a simple implementation, but it doesn't catch the error condition where more than one Boolean is True:
There's lot's of ways your code can find which Boolean is True. Which way makes the most sense to you?
05-16-2025 10:19 AM
@jrossy_1191 wrote:
I currently have 3 different boolean values being produced by my program. At any 1 time, only 1 of them is equal to 1 and the others are equal to 0. I want to have a case statement which I can use to create a different numeric value based on which boolean value is equal to 1. How can I differentiate between the boolean values in order to use them in my case structure?
Note: Once i have the right case selected the number will be sent to RobotStudio.
How about something like this?
05-16-2025 01:39 PM - edited 05-16-2025 01:43 PM
@jrossy_1191 wrote:
I currently have 3 different boolean values being produced by my program. At any 1 time, only 1 of them is equal to 1 and the others are equal to 0. I want to have a case statement which I can use to create a different numeric value based on which boolean value is equal to 1. How can I differentiate between the boolean values in order to use them in my case structure?
If only exactly one boolean must be true, I recommend to use a radio button instead.