Eyvind Axelsen wrote:
This sounds like a typical application for a recursive procedure that walks the
child nodes of a given node. If you have a limited amount of items and are
using VFP9, you can use increase the STACKSIZE parameter in your config.fpw
file. It's a shame that the fox is not better suited for recursivity.
Good luck!
Eyvind.
OK - got it:
PARAMETERS nodeParent
*!* Walks the specified source parent treeview node,
*!* and all of its children nodes
*!*
*!* nodeParent: parent node to walk
LOCAL nodeChild As Node
nodeParent.Selected = .T.
WAIT WINDOW TIMEOUT 1
*!* Get the current parent node's first child
nodeChild = nodeParent.Child
*!* Now walk through the current parent node's children
DO WHILE Not ISNULL(nodeChild)
*!* If the current child node has its own children...
If nodeChild.Children > 0
*!* Recursively DO this proc walking the child node
*!* (which becomes the new parent node)
THISFORM.WalkTree(nodeChild)
Else
*!* Process the child node
nodeChild.Selected = .T.
WAIT WINDOW TIMEOUT 1
ENDIF
*!* Get the current child node's next sibling
nodeChild = nodeChild.Next
ENDDO
RETURN
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.