Previous Topic: Decimal Precision AttributesNext Topic: Function Calls


Repeating Group Views

Repeating groups can be in import and export views. The repeating group view has two variables added to the view structure:

The following is an example of export repeating group view.

/* Repeating Group View: ALL_OUTPUT */
/* Repeats: 30 times */
struct {
    long cardinality;
    char active_flag[30];
    /* Entity View: EXPORT */
    /* Type: WI_SELECTION */

    struct {
        char    value[30][2];
    } export_wiSelection;

    /* Entity View: EXPORT */
    /*        Type: EMPLOYEE */
    struct {
        long    number[30];
        char    name[30][31];
    } export_employee;

    /* Entity View: EXPORT */
    /*        Type: DIVISION */
    struct {
        short   number[30];
        char    name[30][31];
    } export_division;
} allOutput;
/* End of Group View: ALL_OUTPUT */

The following is an example section of code to display the export repeating group values:

printf("List of Divisions\n");
if (server_maintain_division.allOutput.cardinality > 0)
{
   printf("\tNumber\tName\n");
   printf("  ------------------------------\n");
  for (loop = 0; loop < server_maintain_division.allOutput.cardinality; loop++)
  {
       printf("\t%d",
               server_maintain_division.allOutput.export_division.number[loop]);
       printf("\t%s\n",
               server_maintain_division.allOutput.export_division.name[loop]);
  }
}
else
   printf("\tNo Data Found\n");
}