# BuildTable Example Function

The following function examples call this example function:

...

    ESSG_PPDATA_T BuildTable (ESSG_PRANGE_T pRange)
    {
    ESSG_PPDATA_T   ppTable;
    ESSG_STR_T      current_str;
    ESSG_USHORT_T   slen = 0;

       pRange->ulRowStart = 0;
       pRange->ulColumnStart = 0;
       pRange->ulNumRows = 2
       pRange->ulNumColumns = 5;
       ppTable = AllocTwoDims(2, 5);

       /* ROW 1 */
       ppTable[0][0].usType = ESSG_DT_BLANK;
       ppTable[0][1].usType = ESSG_DT_BLANK;

       slen = strlen("Year");
       current_str = malloc(sizeof(ESSG_CHAR_T)*(slen+2));
       *current_str = slen;
       strcpy( (current_str + 1), "Year");
       ppTable[0][2].usType = ESSG_DT_STRING;
       ppTable[0][2].Value.pszStr = current_str;

       slen = strlen("Product");
       current_str = malloc(sizeof(ESSG_CHAR_T)*(slen+2));
       *current_str = slen;
       strcpy( (current_str + 1), "Product");
       ppTable[0][3].usType = ESSG_DT_STRING;
       ppTable[0][3].Value.pszStr = current_str;

       slen = strlen("Market");
       current_str = malloc(sizeof(ESSG_CHAR_T)*(slen+2));
       *current_str = slen;
       strcpy((current_str + 1), "Market");
       ppTable[0][4].usType = ESSG_DT_STRING;
       ppTable[0][4].Value.pszStr = current_str;

       /*** ROW 2 ***/
       slen = strlen("Actual");
       current_str = malloc(sizeof(ESSG_CHAR_T)*(slen+2));
       *current_str = slen;
       strcpy((current_str + 1), "Actual");
       ppTable[1][0].usType = ESSG_DT_STRING;
       ppTable[1][0].Value.pszStr = current_str;
       ppTable[1][1].usType = ESSG_DT_STRING;

       slen = strlen("Sales");
       current_str = malloc(sizeof(ESSG_CHAR_T)*(slen+2));
       *current_str = slen;
       strcpy( (current_str + 1), "Sales");
       ppTable[1][1].Value.pszStr = current_str;

       ppTable[1][2].usType = ESSG_DT_DOUBLE;
       ppTable[1][2].Value.dblData = 123.45;
       ppTable[1][3].usType = ESSG_DT_BLANK;
       ppTable[1][4].usType = ESSG_DT_BLANK;

       return (ppTable);
    }