.. highlightlang:: us .. _tablesetformatindex: TableSetFormatIndex =================== .. index:: TableSetFormatIndex .. us.tag TableSetFormatIndex table.set New400 :ref:`TableSetFormatIndex` sets the format indices. .. function:: bool = TableSetFormatIndex(hTable, rmFormatIndex) bool = TableSetFormatIndex(hTable, rmFormatIndex, rvSel) .. us.return **Return Value** If the function succeeds, the return value *bool* is TRUE (1); otherwise it is FALSE (0). .. us.params **Parameters** .. uparam:: hTable Identifies the table object. .. uparam:: rmFormatIndex *rmFormatIndex* is a matrix of format indexes. A format index value corresponds to a row number in the format table as returned by :ref:`TableGetFormatList`. .. uparam:: rvSel *rvSel* is a vector with four elements specifying a range of rows and columns: .. list-table:: :header-rows: 1 * - Element - Description * - rvSel[1] - Left column of selection * - rvSel[2] - Top row of selection * - rvSel[3] - Right column of selection * - rvSel[4] - Bottom row of selection The column and row numbering starts with 1. Left is smaller than right and top is smaller than bottom. .. us.example **Example** :: hDoc = DocCreate() hPage = PageCreate(); DocAddPage(hDoc, hPage); hvLayer = PageGetAllLayers(hPage) // 1. Layer ist der Hindergrund hLayer = hvLayer[1]; hTable = TableCreate(2, 12); // 2 Spalten, 12 Zeilen rmData = rand(10,2) // 10*2 Matrix mit Zufallswerten smMatrix = smprintf("%.10lf", rmData); // 10*10 String-Matrix mit 10 Nachkommastellen smMatrix = ["x", "y"; "Nm", "kg"; smMatrix]; TableSetText(hTable, smMatrix); iFormat = TableAddFormat(hTable, 2, "%.2lf"); // Zahlen mit 2 Nachkommastellen anzeigen. TableSetFormatIndex(hTable, zeros(12,2) + iFormat) OBJSetPosSize(hTable, [10,-10, 0, 0]); LayerAddObjects(hLayer, hTable); .. seealso:: :ref:`overview-table`, :ref:`TableGetFormatList`, :ref:`TableGetFormatIndex`, :ref:`TableAddFormat` :sub:`id-549224`