SETTABLECELL: Difference between revisions

From iMath
Jump to navigation Jump to search
No edit summary
No edit summary
Line 28: Line 28:
2.2.0 or earlier.
2.2.0 or earlier.


Up to version 2.2.6 only literal strings are allowed, not string expressions
Up to version 2.2.6 only literal strings are allowed for table name and cell reference, not string expressions
}}
}}
[[Category:Data exchange]]
[[Category:Data exchange]]

Revision as of 13:49, 1 September 2018

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