i delete a node and after that i try to check with "if (?) then"
is this Node exist.
My Question: how can i do it ?
regards
> the adress of inserted Node's i save to a TClientDataSet String field.
Why are you storing the node's *address* ???? That is a dynamic value. The
next time the app is run, the values will be different.
What EXACTLY are you trying to accomplish?
> i delete a node and after that i try to check with "if (?) then"
> is this Node exist.
>
> My Question: how can i do it ?
Asside from simply setting your pointer to nil when you delete it, about all
you can do is just loop through the entire TreeView checking each node to
see if it matches the value you have.
Gambit
1. i try to stor the adress temporarly to bind TTreeView with TClientDataSet. I move change or delete any Node and after that i try to insert the Node with the stored adress from TClientDataSet to among an another Node and so on....
2. I also try to check a Node:= Pointer(inttostr(TClientDataSet['StringPointer'])), how i check a Pointer if there is yet valid
?
regards.
> 1. i try to stor the adress temporarly to bind TTreeView with
> TClientDataSet.
That still does not explain why you are storing the *memory address* of the
TreeNode. That is a completely wrong thing to do. You should be storing
some kind of identifier that is inside the Node's data instead, and then
look up the current Node object for it when needed.
> I move change or delete any Node and after that i try to insert the
> Node with the stored adress from TClientDataSet to among an
> another Node and so on....
There is no guarantee that the adress will still be valid by that time.
> 2. I also try to check a Node:=
> Pointer(inttostr(TClientDataSet['StringPointer'])),
> how i check a Pointer if there is yet valid
I already told you how. You would have to loop through the entire TreeView
one node at a time until you find the address. That is the only safe way to
do it.
Gambit