At this time I am working with an array of record:
type
part= record
id:integer;
cap:string;
lv:integer; //level of node
end;
const parts : array[0..3] of part =
(
(id:1;cap:'AAA';lv:1),(id:2;cap:'A1';lv:1),
(id:3;cap:'A2';lv:2),(id:4;cap:'A3';lv:1) ) ;
grid.rowcount:=1;
node:=tmynode(treeedit[0]);
tmynode(treeedit[0]).caption:='ROOT';
i:=0;
while not end of array do
level :=parts[i].lv;
if level=node.treelevel then
current:=node.add(tmynode);
else if level>node.treelevel then // add new child
node:=current.add(tmynode)
else // add node to corresponding parent in the tree. ( my problem is here
....
....
....
( last node. added ).caption:=parts[i].cap;
inc(i);
end; //end while
Do you understand what I want to do?
Later I wish to restore the tree from db file and why not uploading this
example to mseuniverse.
Regards.
Med
________________________________
De : Martin Schreiber <[email protected]>
Envoyé : samedi 28 juillet 2018 17:59
À : [email protected]
Objet : Re: [MSEide-MSEgui-talk] treeitemedit
On Saturday 28 July 2018 19:34:58 mohamed hamza wrote:
> You propose a recursive procedure
>
>
> procedure loadchildren(anode: <tchildnode>);
>
>
> Then while <..> loop must be deleted and replaced with (if not end of data)
>
> is'nt it?
>
"if not end of child data of current node".
What do you want to achieve? How does the database structure look?
Martin
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk