FlowCanvas Forums › Support › Logical signal suggestion › Reply To: Logical signal suggestion
Hey 🙂
While I have already created aliases for those operators in the latest version, there is a small bug that disallows actually searching by those aliases when there are 2 characters (* and / should work though).
If you want to fix this now, please open up StringUtils.cs file and replace whole method named “SearchMatch” with this code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
///Returns whether or not the input is valid for a search match vs the leaf + optional category. public static bool SearchMatch(string input, string leafName, string categoryName = "") { if ( input == null || leafName == null ) return false; if ( categoryName == null ) { categoryName = string.Empty; } if ( leafName.Length <= 1 && input.Length <= 2 ) { string alias = null; //usually only operator like searches are less than 2 if ( ReflectionTools.op_CSharpAliases.TryGetValue(input, out alias) ) { return alias == leafName; } } if ( input.Length <= 1 ) { return input == leafName; } //ignore case input = input.ToUpper(); leafName = leafName.ToUpper().Replace(" ", string.Empty); categoryName = categoryName.ToUpper().Replace(" ", string.Empty); var fullPath = categoryName + "/" + leafName; //treat dot as spaces and split to words var words = input.Replace('.', ' ').Split(CHAR_EMPTY_ARRAY, StringSplitOptions.RemoveEmptyEntries); if ( words.Length == 0 ) { return false; } //last input char check if ( input.LastOrDefault() == '.' ) { return categoryName.Contains(words[0]); } //check match for sequential occurency var leftover = fullPath; for ( var i = 0; i < words.Length; i++ ) { var word = words<em class="d4pbbc-italic"></em>; if ( !leftover.Contains(word) ) { return false; } leftover = leftover.Substring(leftover.IndexOf(word) + word.Length); } //last word should also be contained in leaf name regardless var lastWord = words[words.Length - 1]; return leafName.Contains(lastWord); } |
With the above change, you will be able to search with “!=”, “>=”, etc.
Let me know if that indeed works for you.
Thanks.
Join us on Discord: https://discord.gg/97q2Rjh