Community articleUFLGetPrevious function
Added by IBM contributorIBM on May 2, 2012
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

No abstract provided.



Description

This function, along with UFLGetNext, is used to traverse horizontally along the form hierarchy. UFLGetPrevious returns the previous node in the tree. For instance, if you call UFLGetPrevious on the Page1 node in your form, it will return the global page node.

Function

   formNodeP UFLGetPrevious(
      formNodeP theFormNode
   );


Parameters

Table 1. Function parameters
ExpressionTypeDescription
theFormNodeformNodePThe formNodeP to retrieve the previous node from.


Returns

The formNodeP that represents the previous node or NULL if no such node exists.

Example

The following example uses UFLGetPrevious in a while loop to horizontally traverse across the form hierarchy until the first node on the branch is reached. The first node is returned.
   formNodeP getFirstNode(formNodeP *theNode)
   {
   formNodeP theFirstNode = NULL;
   formNodeP thePreviousNode;
 
      if(*theNode != NULL)
      {
         thePreviousNode = UFLGetPrevious(*theNode);
      }
      while (thePreviousNode != NULL)
      {
         reportNodeInfo(&thePreviousNode);
         theFirstNode = thePreviousNode;
         thePreviousNode = UFLGetPrevious(thePreviousNode);
      }
      return theFirstNode;
   }


Parent topic:
FormNodeP functions