AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Count tree root nodes

Ein Thema von WojTec · begonnen am 26. Aug 2014 · letzter Beitrag vom 26. Aug 2014
Antwort Antwort
Benutzerbild von jaenicke
jaenicke
Online

Registriert seit: 10. Jun 2003
Ort: Berlin
9.962 Beiträge
 
Delphi 12 Athens
 
#1

AW: Count tree root nodes

  Alt 26. Aug 2014, 11:03
If performance is an issue for you, why don't you use the virtual trees? They are faster by orders of magnitude...
http://www.jam-software.com/virtual-treeview/

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.
Sebastian Jänicke
AppCentral
  Mit Zitat antworten Zitat
Benutzerbild von Sir Rufo
Sir Rufo

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

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
WojTec

Registriert seit: 17. Mai 2007
482 Beiträge
 
Delphi XE6 Professional
 
#3

Re: Count tree root nodes

  Alt 26. Aug 2014, 13:36
I used @Uwe Raabe and @Sir Rufo method, also thanks for explanation
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 06:59 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz