luca-0
1
Is it possible to use the switch for something other than numbers,
for example a boolean where you just have the cases true and false.
I know I can use IF statements but the whole point of the switch is too have the same functionality with less clutter.
So is it possible?
Yes, you can use a Switch for a boolean.
For TRUE, use CASE 1.
For FALSE, you can use either CASE 0 or the Default Case.
![image](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/6/66613548493029503f5a0a65f74535b7e2be8afb.png)
![image](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/5/525e1e1c069aa015d29accdcaa7f7fb7a9c02fe8.png)
luca-0
3
I see, Thanks. and is there any way to make it work with strings aswell? so with custom words? or do I need to use the IF statement for that.
jha
4
Yes, it’s better to use the if elseif statement for that
1 Like