Board index » delphi » PLEASE HELP ME - TREEVIEW COMPONENT QUESTION

PLEASE HELP ME - TREEVIEW COMPONENT QUESTION

Does anyone know what the limit of "nodes" is on the treeview
component?  When I add past a certain point, it just quits adding.  I
am trying to create an application that has a dynamic number of
"nodes".  For example:

Employee email address 1
 |      |----Incoming
 |      |         |------Total #
 |      |         |          |--------(the total # of incoming emails]
 |      |         |
 |      |         |------Addresses
 |      |                   |--------[address of incoming email]
 |      |                   |--------[next email address]
 |      |                   |--------[etc]
 |      |
 |      |----Outgoing
 |               |------Total #
 |               |          |-------[the total # of outgoing emails]
 |               |
 |               |
 |               |------Addresses
 |                          |-------[address of outgoing email]
 |                          |-------[next email address]
 |                          |-------[etc]
 |
Next employee email address
etc.....

Please help.  Also, if you can think of a better way to display this
information than a tree view, let me know.  Thanks!

 

Re:PLEASE HELP ME - TREEVIEW COMPONENT QUESTION


In article <fejtcscpvikc7jtmgns494ghtahmnqm...@4ax.com>,

Quote
no...@nowhere.com wrote:
> Does anyone know what the limit of "nodes" is on the treeview
> component? When I add past a certain point, it just quits adding. I
> am trying to create an application that has a dynamic number of
> "nodes". For example:

There shouldn't be a limit, aside from your available memory. Certainly
I've built trees of a couple hundred nodes and had no problems. (Well,
none like the one you're describing . . . )

(The following assumes you are adding nodes at runtime.) Are you
checking the node you get back from all the AddXXX function calls? Have
you tried wrapping the section where you add the nodes with a try . .
except block? Have you tried stepping through the source with the
de{*word*81}? If it consistently fails at the same point, set a breakpoint
with a condition that will catch that point, then step through to see
what happens after that. If you are using a raw pointer somewhere, or
overstepping the bounds of an array, you may be stomping on the memory
space where the node list is stored, which can cause erratic results.

Just a few thoughts on things you can check.
____________________________________________
T I M K E A T I N G

Sent via Deja.com http://www.deja.com/
Before you buy.

Re:PLEASE HELP ME - TREEVIEW COMPONENT QUESTION


Thanks... I'm checking on these things now.  I tried wrapping with a
try..except with no luck.  I am going to check on how to check nodes
from addchild commands.  I'll let you know.  Thank you.

- Robert Smith

Quote
On Wed, 15 Mar 2000 03:53:49 GMT, tim_keat...@my-deja.com wrote:
>In article <fejtcscpvikc7jtmgns494ghtahmnqm...@4ax.com>,
>no...@nowhere.com wrote:
>> Does anyone know what the limit of "nodes" is on the treeview
>> component? When I add past a certain point, it just quits adding. I
>> am trying to create an application that has a dynamic number of
>> "nodes". For example:

>There shouldn't be a limit, aside from your available memory. Certainly
>I've built trees of a couple hundred nodes and had no problems. (Well,
>none like the one you're describing . . . )

>(The following assumes you are adding nodes at runtime.) Are you
>checking the node you get back from all the AddXXX function calls? Have
>you tried wrapping the section where you add the nodes with a try . .
>except block? Have you tried stepping through the source with the
>de{*word*81}? If it consistently fails at the same point, set a breakpoint
>with a condition that will catch that point, then step through to see
>what happens after that. If you are using a raw pointer somewhere, or
>overstepping the bounds of an array, you may be stomping on the memory
>space where the node list is stored, which can cause erratic results.

>Just a few thoughts on things you can check.
>____________________________________________
>T I M K E A T I N G

>Sent via Deja.com http://www.deja.com/
>Before you buy.

Re:PLEASE HELP ME - TREEVIEW COMPONENT QUESTION


Ok...  Maybe I am doing something wrong, but I have no idea.  I am
just beginning with Delphi, so please forgive me for not knowing alot
about the language.  Here is an example of my code (this is just
pseudo code to get the point across):

assign and open addressfile             (addressfile is just a text
                                         file that has the email
                                         addresses we want to
                                         search the log file)

assign and open logfile                 (logfile is just a text log
                                         file we search for a match
                                         of our address string)

{ add root node }
rootnode:=treeview1.items.add(nil,'Addresses');

while not eof(addressfile) do
        begin
                readln(addressfile,addressstring);

                { add a node for the new email address }
                addressnode:=treeview1.items.addchild(rootnode,addressstring);

                { add incoming and outgoing nodes under address node }
                incnode:=treeview1.items.addchild(addressnode,'Incoming');
                outnode:=treeview1.items.addchild(addressnode,'Outgoing');

                while not eof(logfile) do
                        begin
                                readln(logfile,instring);

                                { search for addressstring in the instring }
                                if search(instring,addressstring) <> 0 then
                                        if search(instring,'incoming') <> 0 then
                                                begin
                                                        find the address in the string
                                                        treeview1.items.addchild(incnode,address found)
                                                end
                                        else if search(instring,'outgoing') <> 0 then
                                                begin
                                                        find the corresponders email in string
                                                        treeview1.items.addchild(outnode,corr. email)
                                                end;
                        end;
        end;

This is the basic gist of what I'm trying to do.  What happens is on
the first email address, it adds about 57 child nodes, doesn't add
anymore, but then adds all the remaining email addresses!!??  I don't
understand why this keeps doing this.  I tried wrapping it with a
try..except block, but it never hit the except portion of the code
(where I put a breakpoint).

Any idea????!!!!

Please help

Thanks in advance again!

Re:PLEASE HELP ME - TREEVIEW COMPONENT QUESTION


DISREGARD.........

GEEZ......

SLAP ME W/THE STUPID STICK

MY RESET WAS OUTSIDE OF THE WHILE SCOPE

Thanks for your help..

Other Threads