Kadaitcha Man ha scritto:
> On 26 January 2010 18:58, Doriano Blengino
> <[email protected]> wrote:
>
>
>> What about using two different properties: .Count (all the items) and
>> .Children.Count (only the children of a specific node)?
>>
>
> I neglected to mention, your idea does not seem to allow for the count
> of root nodes.
>
Actually I expressed myself badly. Example:
Tree1:
- item0
- item1
- item1.0
Tree1.count is 3 (global count)
Tree1.Children.count is 2 (tree1 has two children)
Tree1.Children[0] is item0
Tree1.Children[0].count is 0
Tree1.Children[1] is item1
Tree1.Children[1].count is 1
Tree1.Children[1].Children[0] is item1.0
AChild = Tree1.Children[1]
for subchild in Achild
... ' just the single child of item1: item1.0
next
ask("Sure to copy " & tree1.count & " file/directories?) ' we will
copy 3 items
for child in Tree1.children
processchild(subchild) ' this line will execute two times
next
sub processchild(child as TreeChild)
dim subchild as TreeChild
' do something with it
alert("Copying " & child.text & "...)
' are there subchildren? Do them recursively
for subchild in child.children
processchild(subchild)
next
end
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Gambas-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gambas-user