07-21-2025 02:26 PM
I am programmatically creating a tree control from which a user can drag and drop into other tree controls for further use. I'm having trouble trying to implement code to deal with duplicate entries when dragging the child tag of my tree control from one tree to the other. I'm using the Match Pattern VI to find if the new tags being added are equal to those that were already existing, but for some reason the match offset pattern is equal to -1 even for strings that are exactly the same. Here is a snippet of the code:
I will also attach the VI to the bottom of this thread. Help would be appreciated.
07-23-2025 11:15 AM
You actually attached a 2025 version of the VI. Most of us can't open it.
07-23-2025 12:38 PM
Why are you using "Match pattern" if you're only caring about an exact match? Why not use the standard "Equals" node?
Match pattern should be used when you expect at least some differences. Maybe you think it might match only a substring, maybe you want to disregard differences in whitespace, and so on.
If you're using it just to look for only exact matches, you risk missing the matches if the "match" string contains control characters like square brackets or periods, and risk false positives for matches if the string you're checking contains the "match" string as a substring.
07-23-2025 12:45 PM
If you're looking to match exact values of strings but would like to be case insensitive, use a "To lowercase" function before both items then compare as equal.
07-23-2025 01:31 PM
Tree ctrl won't allow duplicated tags.
If you already have a tag "abc", when you try to add another "abc", you will get "abc_1", although in display you have 2 "abc".
I can't open your VI. I don't know what you use in Frames & Signals.