How to make comparison of custom classes in vl?

How can I implement the IComparable interface for my class?

Try to turn off the generic flag on the operation. Does it work then?

1 Like

Thanks!
But still there is a question

you can use Sort (Comparer) as described here: Sort index in VL

It’s good advice, but I dont need to sort anything, it’s just an example.
There is cases when external library (nuget) use IComparable to compare something. I asked myself when I tried use custom classes for the finite state machine nuget as state — it’s interesting, dont think so?. Maybe it’s not a good practice to implement custom comparator in this type of tasks, but it’s very interesting question — is it possible at all? Or maybe it will be possible later?

Example: StateMachine_Class.vl (38.6 KB)
I’m not sure at all if there is a comparison going on there. But I don’t even know how to try.

изображение

UPD: I looked closely at the error and realized that the problem is definitely not in the IComparable implementation

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.