SETTABLECELL

From iMath
Jump to: navigation, search

Syntax

SETTABLECELL { expression , expression , expression }

Implemented in iMath since version 2.2.0 or earlier.

Up to version 2.2.6 only literal strings are allowed for table name and cell reference, not string expressions.

Explanation

Set the value, string or formula of a table cell. The first string expression must contain the table name and the second string expression the cell reference (you can see both if you click into the table cell and then look at the status bar at the bottom of the Writer window). You must reference a single cell. iMath checks whether the expression is a real number and sets the table cell to a double-precision floating point value. If the expression is a string and begins with =, iMath will set the table cell to a formula. Otherwise the table cell will be set to a text.

Starting with iMath 2.2.6, the second expression may be a vector or an array containing string expressions. iMath will set the values of the referenced cells. If the third expression is a single value, all cells will be set to that value. If it is a vector or array of the same dimension, the referenced cells will be set to the values from the vector/array.

Example

The following example will increment the value in cell A1 of table Tabelle1 at each iMath recalculation run.

EQDEF cell = "a1"

EQDEF z = TABLECELL("Tabelle1", VAL(cell))

SETTABLECELL {"Tabelle1", VAL(cell), VAL(z+1)}

Note that VAL is required here to create a string expression from the variable.

See also

CALCCELL SETCALCCELLS TABLECELL