Community articleLoading a Form
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

Before your program can begin working with a form, you must load it into memory. CalculateAge does this by defining a loadForm function to handle these tasks.
Call UFLReadForm within the implementation of your loadForm function to read in the form, calculateAge.xfd.
      r_short loadForm(formNodeP *form)
      r_short loadForm(form)
      formNodeP *form;
   /* Call UFLReadForm. The parameters are:
      1. calculateAge.xfd : indicates the file on the local drive to read the
         form from.
      2. 0 : because we do not need the #include lines to be resolved.
      The UFLReadForm will return a pointer to the root node of the new form
      structure once it is loaded into memory. */
      if ((*form = UFLReadForm("calculateAge.xfd", 0)) == NULL)
         reportError("Could not load form.\n", 0);