To export table rows to table element LABPP_Table.gsm.


ts_table(iTable, "export_to_LABPP_Table", bool withheader, int startcolindex, int startObjectrow, int starttablerow, int maxrows, string digit_delimiter);
или
ts_table(iTable, "export_to_LABPP_Table", bool withheader, int startcolindex, int startObjectrow, int starttablerow, int maxrows, string digit_delimiter, int iLABPP_TableGuidDescr);


Here:

withheader = 0/1 - with or without headings

startcolindex - 1-based start column index on result table;

startObjectrow - 1-based row index in result table object, where needed to place source table;

starttablerow - 0-based row index in source table from what do export;

digit_delimiter - the delimiter in floating point digital that use in export ("." or ",")

maxrows - count of rows to export (-1 - all).


Example.

Create table and write it to selected object element LABPP_Table in the project.


int main()

{

       int iTable;

       object("create", "ts_table", iTable); // create table in memory


       // Create table's columns

       ts_table(iTable, "add_column", 0, "string", "My first column");

       ts_table(iTable, "add_column", 1, "double", "My second column with number");

       ts_table(iTable, "add_column", 2, "string", "Comments");


       // Strings addition

       ts_table(iTable, "add_row", 0, "String 1", 1, 10000.1111, 2, "Comment 1"); 

       ts_table(iTable, "add_row", 0, "String 2", 1, 20000.2222);

       ts_table(iTable, "add_row", 0, "String 3", 1, 30000.335, 2, "Comment 3");


       // Load table object LABPP_Table

       ac_request("load_elements_list_from_selection", 1, "ObjectType", "ObjectName", "LABPP_Table", "MainFilter", 2);

       ac_request("get_loaded_elements_list_count", 1);

       int icount = ac_getnumvalue();

       int i;

       bool withheader = true;

       int startcolindex = 1;

       int startObjectrow = 1;

       int starttablerow = 0;

       int maxrows = -1;

       int maxcolumns;

       // get columns and rows counts

       ts_table(iTable, "get_columns_count", maxcolumns);

       ts_table(iTable, "get_rows_count", maxrows);


       // Review all loaded elements LABPP_Table. If needed only one - You can do not loop creating.

       for (i = 0; i < icount; i++)

       {

               // Set object № i from list #1 as current 

               ac_request("set_current_element_from_list", 1, i);

               // Place to him table's content (use in digitals delimiter ",")

               ts_table(iTable, "export_to_LABPP_Table", withheader, startcolindex, startObjectrow, starttablerow, maxrows,",");

               // Set in table object count of used rows

               ac_request("set_object_property_value", "TS_RowsUsedCount", maxrows+1);

               // Set in table object count of used columns

               ac_request("set_object_property_value", "TS_ColumnsUsedCount", maxcolumns);

               // Send message to object to do internal refresh

               ac_request("set_object_property_value", "TS_DoRecalcAll", 1);

       }

       // Remove table from memory

       object("delete", iTable);

}


As result programm place this information to table.