Specialization patch not found

Specialization patch not found

Trying to use switch-case, the logic is.

Blink the led wih T1 when notthing happens
Blink the led with T0.5 when Button 1 is pressed

But as you can see it’s giving me an odd error i cannot get. Any help?

Hi! iamthevector
It is not necessary to use the switch case construction in the presence of a single condition.
In my opinion, the task is easily solved without using the switch-case. Like this:


Inside, the switch-case compares the input pin IN value with values at the X1, X2, X3 pins, using the generic equal node. For the equal the boolean specialization is not necessary as the Boolean can only be either 0 or 1. It’s a bit illogical.

Still, if you want to use the switch-case try to get rid of the boolean type.
Like this:

Yes i posted just a 1 condition switch case just for example purposes, but the final software should have more behaviour.

So the problem is that the switch-case method is just for numbers and not booleans? This should be explicited in the switch-case page that tell the users that the switch-case has generic input. This is not true and misleading.


Thanks for the help

So do you want to expand it something like this?


As a quick solution, you can provide the missing implementation yourself.
Create a patch named equal(boolean), copy the insides of equal(byte) into it, and replace byte inputs with boolean inputs. In the end, it should look like this:

We should probably add equal(boolean) in the future release, as it could be useful in many other cases as well.

Nice, that’s a good solution. But what should i write inside the not-implemented block?

But what should i write inside the not-implemented block?

The implementation from equal(byte) will work perfectly fine. In fact, if you actually copy the insides of equal(byte) (I mean literally select the nodes, copy and paste, not recreate from scratch), the C++ implementation associated with not-implemented-in-xod node will be copied as well, so you don’t have to write anything :slight_smile:

Or you can throw away the not-implemented-in-xod node and use xor and not: