SETTABLECELL: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{Keyword| | {{Keyword | ||
<code>SETTABLECELL | | | ||
|2= | 1= | ||
Set the value, string or formula of a table cell. The first string must contain the table name and the second string 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 <code>=</code>, iMath will set the table cell to a formula. Otherwise the table cell will be set to a text. | <code>SETTABLECELL { [[expression]] , [[expression]] , [[expression]] }</code> | ||
|3= | | | ||
|4= | 2= | ||
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 <code>=</code>, iMath will set the table cell to a formula. Otherwise the table cell will be set to a text. | |||
| | |||
3= | |||
The following example will increment the value in cell <code>A1</code> of table <code>Tabelle1</code> at each iMath recalculation run. | |||
<code> | |||
EQDEF cell = "a1" | |||
EQDEF z = TABLECELL("Tabelle1", VAL(cell)) | |||
SETTABLECELL {"Tabelle1", VAL(cell), VAL(z+1)} | |||
</code> | |||
Note that [[VAL]] is required here to create a string expression from the variable. | |||
| | |||
4= | |||
[[CALCCELL]] [[SETCALCCELLS]] [[TABLECELL]] | [[CALCCELL]] [[SETCALCCELLS]] [[TABLECELL]] | ||
| | |||
5= | |||
2.2.0 or earlier. | |||
Up to version 2.2.6 only literal strings are allowed, not string expressions | |||
}} | }} | ||
[[Category:Data exchange]] | [[Category:Data exchange]] |
Revision as of 19:03, 29 August 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, 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.
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.