TableSetFormatIndexΒΆ

TableSetFormatIndex sets the format indices.

bool = TableSetFormatIndex(hTable, rmFormatIndex)
bool = TableSetFormatIndex(hTable, rmFormatIndex, rvSel)

Return Value

If the function succeeds, the return value bool is TRUE (1); otherwise it is FALSE (0).

Parameters

hTable

Identifies the table object.

rmFormatIndex

rmFormatIndex is a matrix of format indexes. A format index value corresponds to a row number in the format table as returned by TableGetFormatList.

rvSel

rvSel is a vector with four elements specifying a range of rows and columns:

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.

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);

id-549224