I’m trying to do a generic macro to detect if a variable has changed.
This node if generic would make my life much easier and even help with performance.
It is already working with an integer, but I wanted to use a wildcard so I could detect changes in any type of variable.
that’s ok if I can’t compare wildcards, but there’s any way to know which type of variable the wildcard is so I can at least use a branch or something like that?
Create a macro library or just add a macro to an existing one.
Follow the second picture and set input and output pins.
Make an array of one of the input elements. By doing this, you will create an array that has only one element in it (Element 0).
Now use the ‘Find’ node to see if the second element (Element 1) can be found inside the array or not. Since the array has only one element, if the find node can’t fine the second element inside the array, it means that the first element is not equal to the second element, and that is exactly the function we were looking for.
use a not equal node to check it out. The find node prints -1 if couldn’t find the element inside the array (here the elements are not equal). So if the ‘Find’ node is not equal to -1, means that the second element could be found inside the array which means the two elements are equal.