Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need some help with the algorithm
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01484275
Message ID:
01484341
Vues:
81
Naomi,

I do not understand the algorithm at all, I do not know what this code is trying to accomplish, but what about working more with the data, wouldn't it be faster?, for example at the beginning you have
* Find a root node in the TreeView
	oTree = .TList2
	if oTree.Nodes.count > 0
		for i = 1 to oTree.Nodes.count
			oTmp = oTree.Nodes(i).parent
			if isnull(oTmp) then
				iTmpIndex = i
				exit
			endif
		next i
Which finds only one of the possible multiple root nodes of the treeview, wouldn't be faster to do
select node_id from ItemTree where parent_id is null into cursor c_roots...
You might even be able to avoid the next step, finding the sibling if you use order by sort_order, I think. Anyways, what I am trying to say is that maybe it is better to work with a mix of data instead of just scanning the tree which might be expensive.
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform