Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
195
Wintree not being recursed correctly
posted

The below code used to work just fine as I recall. However, either I can't

get this to work correctly anymore due to a bug in my code or there's

something wrong with 11.1 UltraWinTree. Does this algorithm look right?


Thanks in advance, Don Bouchard


I'm calling this as follows:


utNodeFound = FindNode(utAccounts, nothing, "KEYDESIRED")



    Private Function FindNode(ByVal ut As UltraWinTree.UltraTreeByVal utNode As UltraWinTree.UltraTreeNodeByVal strKey As StringAs UltraTreeNode         Dim utNodes As TreeNodesCollection         ' If utNode is null, then assume we're starting at the top of the tree         ' otherwise, get this level's nodes and search them for a match         If utNode Is Nothing Then             utNodes = ut.Nodes         Else             utNodes = utNode.Nodes         End If         ' Now search in this level's nodes collection for a match         For Each utn As UltraTreeNode In utNodes             If String.Compare(utn.Key.Trim, strKey.Trim, True) = 0 Then                 Return utn             End If             If utn.HasNodes Then Return FindNode(ut, utn, strKey)         Next         Return Nothing     End Function
Parents
  • 53790
    posted

    Hello Don,

     

    I try to reproduce your scenario in a small sample following provided code. Could you please take a look at the attached sample where I made small changes into your code.  Please let me know if you think that I didn`t reproduce your scenario or if you have any questions.

    Regards

    Test 21.zip
Reply Children
No Data