hi all, happy newyear
I have been trying to create a boolean switch and have created this using c# node
it works but very long and seems a bad way write are there any suggestion how to write this better I need to
have 20 booleans. Many thanks
switch(Input)
{
case 1:
PAPER1 = true;
PAPER2 = false;
PAPER3 = false;
PAPER4 = false;
PAPER5 = false;
PAPER6 = false;
PAPER7 = false;
PAPER8 = false;
PAPER9 = false;
PAPER10= false;
PAPER11= false;
PAPER12= false;
break;
case 2:
PAPER1 = true;
PAPER2 = true;
PAPER3 = false;
PAPER4 = false;
PAPER5 = false;
PAPER6 = false;
PAPER7 = false;
PAPER8 = false;
PAPER9 = false;
PAPER10 = false;
PAPER11 = false;
PAPER12 = false;
break;
case 3:
PAPER1 = true;
PAPER2 = true;
PAPER3 = true;
PAPER4 = false;
PAPER5 = false;
PAPER6 = false;
PAPER7 = false;
PAPER8 = false;
PAPER9 = false;
PAPER10 = false;
PAPER11 = false;
PAPER12 = false;
break;
case 4:
PAPER1 = true;
PAPER2 = true;
PAPER3 = true;
PAPER4 = true;
PAPER5 = false;
PAPER6 = false;
PAPER7 = false;
PAPER8 = false;
PAPER9 = false;
PAPER10 = false;
PAPER11 = false;
PAPER12 = false;
break;
case 5:
PAPER1 = true;
PAPER2 = true;
PAPER3 = true;
PAPER4 = true;
PAPER5 = true;
PAPER6 = false;
PAPER7 = false;
PAPER8 = false;
PAPER9 = false;
PAPER10 = false;
PAPER11 = false;
PAPER12 = false;
break;
case 6:
PAPER1 = true;
PAPER2 = true;
PAPER3 = true;
PAPER4 = true;
PAPER5 = true;
PAPER6 = true;
PAPER7 = false;
PAPER8 = false;
PAPER9 = false;
PAPER10 = false;
PAPER11 = false;
PAPER12 = false;
break;
case 7:
PAPER1 = true;
PAPER2 = true;
PAPER3 = true;
PAPER4 = true;
PAPER5 = true;
PAPER6 = true;
PAPER7 = true;
PAPER8 = false;
PAPER9 = false;
PAPER10 = false;
PAPER11 = false;
PAPER12 = false;
break;
case 8:
PAPER1 = true;
PAPER2 = true;
PAPER3 = true;
PAPER4 = true;
PAPER5 = true;
PAPER6 = true;
PAPER7 = true;
PAPER8 = true;
PAPER9 = false;
PAPER10 = false;
PAPER11 = false;
PAPER12 = false;
break;
case 9:
PAPER1 = true;
PAPER2 = true;
PAPER3 = true;
PAPER4 = true;
PAPER5 = true;
PAPER6 = true;
PAPER7 = true;
PAPER8 = true;
PAPER9 = true;
PAPER10 = false;
PAPER11 = false;
PAPER12 = false;
break;
case 10:
PAPER1 = true;
PAPER2 = true;
PAPER3 = true;
PAPER4 = true;
PAPER5 = true;
PAPER6 = true;
PAPER7 = true;
PAPER8 = true;
PAPER9 = true;
PAPER10 = true;
PAPER11 = false;
PAPER12 = false;
break;
case 11:
PAPER1 = true;
PAPER2 = true;
PAPER3 = true;
PAPER4 = true;
PAPER5 = true;
PAPER6 = true;
PAPER7 = true;
PAPER8 = true;
PAPER9 = true;
PAPER10 = true;
PAPER11 = true;
PAPER12 = false;
break;
case 12:
PAPER1 = true;
PAPER2 = true;
PAPER3 = true;
PAPER4 = true;
PAPER5 = true;
PAPER6 = true;
PAPER7 = true;
PAPER8 = true;
PAPER9 = true;
PAPER10 = true;
PAPER11 = true;
PAPER12 = true;
break;
default: OFF();
break;
Hello Ventuzians!
THE FORUMS ARE CLOSED!
Please join our discord server HERE!! << click me
We are shutting our Ventuz Forum, but don't worry, it will all be archived for you to search in if you have a query. From now on, please add all your comments, questions or observations into our Discord Server
Thanks for the great time - see you on discord!!
Dee, Karol, Daniel and the whoooole Product and Support team!
THE FORUMS ARE CLOSED!
Please join our discord server HERE!! << click me
We are shutting our Ventuz Forum, but don't worry, it will all be archived for you to search in if you have a query. From now on, please add all your comments, questions or observations into our Discord Server
Thanks for the great time - see you on discord!!
Dee, Karol, Daniel and the whoooole Product and Support team!
boolean switch help :)
Moderator: Support
Re: boolean switch help :)
Hi,
depends a bit on what you're planning to do with those output bools. Here are three examples using int expressions, containers or a script with a bool array. Maybe one of those does what you want. Try not to use the script version if you need to copy it a lot.
cheers,
rou
depends a bit on what you're planning to do with those output bools. Here are three examples using int expressions, containers or a script with a bool array. Maybe one of those does what you want. Try not to use the script version if you need to copy it a lot.
cheers,
rou
- Attachments
-
- bools.vza
- (10.74 KiB) Downloaded 545 times
Re: boolean switch help :)
Many thanks rou, this helped me create what i needed which was like the switch node but inverted
thanks again.
thanks again.
- Attachments
-
- inverted_switch.vza
- (14.14 KiB) Downloaded 554 times
- Daniel Willer
- Posts: 309
- Joined: 06 Jan 2012, 18:12
Re: boolean switch help :)
The best and simplest waz to do it is using a ValueDispatcher node.
Regards
Daniel
Regards
Daniel
Re: boolean switch help :)
Hi Daniel,
thanks I posted in V4 by mistake but the place i'm at they are using ventuz 3 I wish they upgraded.
thanks I posted in V4 by mistake but the place i'm at they are using ventuz 3 I wish they upgraded.
- Daniel Willer
- Posts: 309
- Joined: 06 Jan 2012, 18:12
Re: boolean switch help :)
Ok I move the topic to V3.
Re: boolean switch help :)
He wanted all outputs i with i <= n to be true, the rest to be false. I don't think the dispatcher can do that, can it?
cheers,
rou
cheers,
rou
Re: boolean switch help :)
I have been concerned about this topic and have been looking for answers. Hoping to find the best solution, we look forward to your sharing. Thank you.