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


Use this function to create a new cell item for a combobox, list, or popup. The UFLCreateCell function adds one new cell to a group on a page in the form. Note that this function can only assign a name to the new cell; it cannot set the value of the cell. To set the value of a cell, you must use the UFLSetLiteralByRefEx function.


   r_error UFLCreateCell(
      formNodeP thePageNode,
      r_charP theCellName,
      r_charP theGroupName,
      formNodeP *theCellPointer);


Table 1. Function parameters
thePageNode formNodePA page level node. The cell is created in this page. Note that this cannot be the global page.
theCellNamer_charPThe name of the new cell being created.
theGroupNamer_charPThe name of the group option to which the new cell will be added.
theCellPointer formNodeP*The pointer to the address where the new cell will be stored.


OK on success or an error code on failure.


This sample code makes two calls to the UFLCreateCell function to add two new cells to the same group:
   /* Create a cell with name green and of group POPUP_GROUP_COLORS. Since
      theForm is the root of the form, we can pass the child's next formNodeP
      in the first parameter */
   if((UFLCreateCell(UFLGetNext(UFLGetChildren(theForm)), "GREEN_CELL",
      "POPUP_GROUP_COLORS", &theCell)) !=OK)
      fprintf(stderr, "Could not create green cell.\n");
   /* Set the value of the new cell to "green" */
   if((UFLSetLiteralByRefEx(theCell, NULL, "value", 0, NULL, NULL, 
      "green")) !=OK)
      fprintf(stderr, "Could not set literal on green cell.\n");
   /* Creates the second cell with name purple and group POPUP_GROUP_COLORS,
      and then sets the value of the new cell to "purple".*/
   if((UFLCreateCell(UFLGetNext(UFLGetChildren(theForm)), "PURPLE_CELL",
      "POPUP_GROUP_COLORS ", &theCell)) != OK)
      fprintf(stderr, "Could not create purple cell.\n");
   if((UFLSetLiteralByRefEx(theCell, NULL, "value", 0, NULL, NULL, 
      "purple")) != OK)
      fprintf(stderr, "Could not set literal for purple cell.\n");

Parent topic:
FormNodeP functions