Thema: Delphi Count tree root nodes

Einzelnen Beitrag anzeigen

Benutzerbild von Sir Rufo
Sir Rufo

Registriert seit: 5. Jan 2005
Ort: Stadthagen
9.454 Beiträge
 
Delphi 10 Seattle Enterprise
 
#5

AW: Count tree root nodes

  Alt 26. Aug 2014, 11:31
And for your problem you have VirtualStringTree1.ChildCount[CurrentNode] .
This property only fetches the appropriate value, because this value is already known, so there is no need for counting or anything. Faster is impossible.
It is fast, because it did not count all wanted nodes
Code:
+-n1
  +-n2
  +-n3
+-n4
  +-n5
  +-n6
Counting all nodes at level 1 should return 4 and not 2
Kaum macht man's richtig - schon funktioniert's
Zertifikat: Sir Rufo (Fingerprint: ‎ea 0a 4c 14 0d b6 3a a4 c1 c5 b9 dc 90 9d f0 e9 de 13 da 60)
  Mit Zitat antworten Zitat