Gentee Programming Language > Documentation > Libraries Download documentation

Trees

Variables of the tree and treeitem (tree item) types allow you to work with "trees". For using this library, it is required to specify the file tree.ge (from Lib subfolder) with include command.

  • Operations
  • Methods
  • Methods for tree items

    Operations

    Operations defined for the variable of tree type are listed below. The second column contains possible statements where typename is a variable or an expression of the specified type.
     
    OperationSyntaxReturn typeComments
    Variable descriptiontree name[i]
    tree name of type
    -Tree description. If no item type is specified, uint is used.
    ** tree
    * treeitem
    uintGet the number of items.
    foreachThe option of using in the foreach operator. A description of an additional variable of the treeitems type is required. The foreach operator is used for variables of the treeitem type and goes through all child items of this object.

    treeitems tis
    ...
    foreach treeitem cur, ti.items( tis )
    {
       ...
    }

    Methods

    tree.clearClearing a tree
    tree.delDeleting an item
    tree.leafAdding a "leaf"
    tree.nodeAdding a "node"
    tree.rootRoot item

    Methods for tree items

    treeitem.changenodeChanging the parent of an item
    treeitem.childGetting the first child
    treeitem.dataGetting
    treeitem.getnextGetting the next item
    treeitem.getprevGetting the previous item
    treeitem.getrootGetting the root item
    treeitem.isleafLeaf
    treeitem.isnodeNode
    treeitem.isrootRoot
    treeitem.lastchildGetting the last child
    treeitem.moveMoving an item
    treeitem.parentGetting the parent


     Copyright © 2004-2006 Gentee Inc. All rights reserved.