Name
Listtree.GetEntry -- get tree entry
Synopsis
found, table = mui.DoMethod(id, "GetEntry", node, position, flags$)
Function
Get another node in relation to the specified list or node. This method allows you to traverse the entire list tree. See below for an example.

"Node" specifies the node which is used to find another one. This can also be a list node, if the position a related to a list. In contrast to all other methods or attributes of Listtree class, "node" must NOT be a string identifier but a special value returned by this method or by Listtree.FindName in the MuiID field of the return table (see below). Alternatively, it can be one of the following special values:

Root
The root list is used.

Active
The list with the active entry is used.

Position specifies the number of nodes of the list specified in "node" or one of the following special values:

Head
The head of the list in "node" is returned.

Tail
The tail of the list is returned.

Active
The active node is returned.

Next
The next node after the tree node "node" is returned.

Previous
The node before the tree node "node".

Parent
The list node of the "node", it's the parent one.

Flags$ can be a combination of the following options:

SameLevel
Only nodes on the same level are affected.

Visible
The position is counted on visible entries only.

If you specify multiple of the flags above, you have to separate them using a semicolon, e.g. "SameLevel; Visible".

This method returns two values: The first return value is a boolean flag which indicates whether or not a node was found. If the first return value is True, the second return value is a table with the following fields initialized:

Name
Name of the tree node.

Node
True if the found entry is a node, False if it is a leaf.

ID
String object identifier of this tree node.

MuiID
Internal MUI ID of this tree node. This is the only id you are allowed to pass in the 'node' argument of this method. Passing standard string object identifiers is not allowed by this method. You can use this value for subsequent calls to Listtree.GetEntry in the "node" argument See above for more information and below for an example.

Inputs
id
id of the listtree object
node
special node identifier returned by this method
position
index of entry to get
flags$
combination of flags to use (see above)
Results
found
boolean flag indicating whether or not an entry was found
table
table containing information about found entry
Example
Function p_DumpListTree(id$, node, indent)
   Local found, t = mui.DoMethod(id$, "GetEntry", node, "Head", "")
   While found = True
      If indent > 0
         DebugPrint(RepeatStr(" ", indent) ..
             IIf(t.Node = True, "+", "") .. t.name)
      Else
         DebugPrint(IIf(t.Node = True, "+", "") .. t.name)
      EndIf
      If t.Node = True Then p_DumpListTree(id$, t.muiid, indent + 4)
      found, t = mui.DoMethod(id$, "GetEntry", t.muiid, "Next", "")
    Wend
EndFunction

p_DumpListTree("mylisttree", "root", 0)
The code above shows how to dump the complete contents of a listtree, preserving its structure.

Show TOC