Yes.
Printable View
Yes.
So you are in fact calling GetPercent(A) (thus contradicting your answer in post #28)
It's quite possible I've contradicted myself lol.
I think you should take a step back, and re-think how to make this simple and re-write your first question in a way that makes sense to us.
Give more example results, etc.
For example write code that creates a list of some of your values, so we can test on our own machines.
PS. Are the values in my post #20 correct? If yes, then why not try to replicate the logic in VB?
Also. I agree with jcis that you should put your data into an array, and then work with it (if you are to do it in VB)
This is why I am so confused. Referring again to the image in your original post, your function Revenues() from post #30, which calls GetPercent(), seems like it wants to iterate through the leaf elements of the tree (C, E, F, H, K, L, & M). In other words, GetPercent() traverses UP the tree.
However, you are also implying the the Commissions table would contain A, and not (C, E, F, H, K, L & M).
Thus, it seems like Revenue is calling GetPercent(A), and GetPercent() traverses up. However, since A is already a root node, it only climbs up one level and exits, thus giving you no useful functionality.
Ya, I'm rewriting it now. I think I'm close. I'll come back if I need your help again.
Thanks, guys!
when i was a boy we built the trees and simply rolled coins down then returning the value as we went
the tree can be traversed in any number of ways
the norm is right node left an in-order traversal for a l<n>r structure
in essence you walk the tree to the left untill you find a nul pointer at the leftchild and insert the sum of ther colected value at the current node then step back to the current node and walk as far right as you can putting the value in the current node when the right child is null
when the walk is complete the values are in the appropriate nodes
here to help more if needed