Community articleUFLSetActiveForComputationalSystem 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.


This function sets whether the computational system is active. When active, all computes in the form are evaluated on an on-going basis. When inactive, no computes are evaluated.
Note that turning the computational system on causes all computes in the form to be re-evaluated, which can be time consuming.


   r_short UFLSetActiveForComputationalSystem(
      formNodeP theForm,
      r_short activeFlag


Table 1. Function parameters
theForm formNodePAny node in the form.
activeFlagr_shortSet to OK to activate the compute system or NOTOK to deactivate the compute system.


OK on success or an error code on failure.


The following example reads a form into memory with the computational system turned off. The example then calls a processing function that adds a large amount of information to the form. Next, UFLSetActiveForComputationalSystem is called to turn the computational system on and evaluate all of the computes. Finally, the updated form is written to disk.
   r_error processForm()
   formNodeP theForm;
   r_error error;
      /* Read the form into memory with the computes turned off */
      if ((theForm = UFLReadForm("input.xfd", UFL_AUTOCOMPUTE_OFF)) == NULL)
         fprintf(stderr, "Could not read form.\n");
      /* Call a function that adds information to the form from a database */
      /* Activate the computational system. This will re-evaluate all
         computes with the new information in the form. */
      if ((error = UFLSetActiveForComputationalSystem(theForm, OK)) != OK)
         fprintf(stderr, "Could not activate compute system.\n");
      /* Write the updated form to disk */
      if ((error = UFLWriteForm("output.xfd", NULL, 0)) != OK)
         fprintf(stderr, "Could not write form to disk.\n");

Parent topic:
FormNodeP functions