Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Traverse a treeview?
Message
 
To
27/01/1999 09:00:00
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00180381
Message ID:
00181469
Views:
11
I got it to work (that is conceptually, more at end of message). Here is the code I used for anyone that is interested:

local iLoop, o, oNode
o = THISFORM.TreeView

*get the first sibling
oNode = o.Nodes[1].FirstSibling
iLoop = 1
messagebox('First Sibling: '+str(iLoop)+' '+oNode.text)
*if children then call TraverseChildren
if oNode.children > 0 then
=ThisForm.TraverseChildren(oNode.child, @iLoop)
endif
*loop thru the rest of the nodes on this level
do while not isnull(oNode.next)
iLoop = iLoop + 1
oNode = oNode.next
messagebox('Next: '+str(iLoop)+' '+oNode.text)
*if children then call TraverseChildren
if oNode.children > 0 then
=ThisForm.TraverseChildren(oNode.child, @iLoop)
endif
enddo


*TraverseChildren is a method for the form
parameters oNodeChild, nSeqNo
nSeqNo = nSeqNo + 1
messagebox('Child: '+str(nSeqNo)+' '+oNodechild.text)
*if children then call TraverseChildren
if oNodeChild.children > 0 then
=ThisForm.TraverseChildren(oNodeChild.child, @nSeqNo)
endif

* loop thru the children
do while not isnull(oNodeChild.next)
oNodechild = oNodechild.next
nSeqNo = nSeqNo + 1
messagebox('Child: '+str(nSeqNo)+' '+oNodechild.text)
*if children then call TraverseChildren
if oNodeChild.children > 0 then
=ThisForm.TraverseChildren(oNodeChild.child, @nSeqNo)
endif
enddo


My problem now is that the 2nd time that I traverse thry the treeview I get exception c0000005 and vfp craps out. I am using VFP5 with the SP3 for it installed and the TreeView control that came with that service pack.
Any suggestions on this error?
Derek Agar
Acctware Business Systems
derekagar@acctware.com
ICQ: 42332100

***********************
When in trouble call 911

He that dwelleth in the secret place
of the most High shall abide under
the shadow of the Almighty.
Psalm 91:1
***********************
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform