Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: recursive type definition  (Read 5656 times)
Lu?s T.
Posts: 39


« on: January 05, 2022, 05:14:59 pm »

Is it possible to dfeini recursive type?
What I need to do is something like:
Code:
TYPE tNode RECORD
  descrption string,
  descendents DYNAMIC ARRAY OF tNode
END RECORD
Leo S.
Four Js
Posts: 126


« Reply #1 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
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines