Community articleLoading a Form
Added by IBM contributorIBM on May 3, 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.



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.
   #ifndef OLD_STYLE_PARAMS
      r_short loadForm(formNodeP *form)
   #else
      r_short loadForm(form)
      formNodeP *form;
   #endif
   {
 
   /* 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);
         return(NOTOK);
      }
      return(OK);
}