Four Js Development Tools Forum

Discussions by product => Genero BDL => Topic started by: Luís Trindade on January 05, 2022, 05:14:59 PM

Title: recursive type definition
Post by: Luís Trindade on January 05, 2022, 05:14:59 PM
Is it possible to dfeini recursive type?
What I need to do is something like:

TYPE tNode RECORD
  descrption string,
  descendents DYNAMIC ARRAY OF tNode
END RECORD
Title: Re: recursive type definition
Post by: Leo Schubert on January 11, 2022, 12:24:36 AM
Hi Luis, no , not possible !
Compare it with C -> only pointers can be in a recursive definition...but we don't have pointers in a RECORD definition.
If you need to have a tree data structure where all you need for a leaf is a string I'd recommend using an om.DomDocument, the om.DomNode.setAttribute can set as many string attributes as you want per node.
Another place to look at is our Tree view samples in $FGLDIR/demo/Tree, here the trick is to work with id,parentId in a flat Genero array to be able to visualize in a Genero Tree View.


HTH and Regards, Leo