Community articleUFLGetPrevious 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


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.


   formNodeP UFLGetPrevious(
      formNodeP theFormNode


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


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


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)
         theFirstNode = thePreviousNode;
         thePreviousNode = UFLGetPrevious(thePreviousNode);
      return theFirstNode;

Parent topic:
FormNodeP functions