Community articleUFLGetChildren function
Added by IBM contributorIBM on July 26, 2013
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

Description

This function, along with UFLGetParent, is used to traverse vertically along the form hierarchy. UFLGetChildren returns the first child of the indicated node. If the node has no children, NULL is returned. All child nodes of a formNodeP can be traversed using a while loop in combination with UFLGetNext.

Function

   formNodeP UFLGetChildren(
      formNodeP theParentNode
   );


Parameters

Table 1. Function parameters
ExpressionTypeDescription
theParentNodeformNodePThe formNodeP to retrieve its child from.


Returns

The formNodeP that represents the child or NULL if no child exists.

Example

The following example uses UFLGetChildren in a while loop to vertically traverse down the form hierarchy until the last node on the branch is reached. The bottom node is returned.
   formNodeP getBottomNode(formNodeP *theNode)
   {
   formNodeP theBottomNode = NULL;
   formNodeP theChild;
 
      if(*theNode != NULL)
      {
         theChild = UFLGetChildren(*theNode);
      }
      while (theChild != NULL)
      {
         reportNodeInfo(&theChild);
         theBottomNode = theChild;
         theChild = UFLGetChildren(theChild);
      }
      return theBottomNode;
   }


Parent topic:
FormNodeP functions