SETCALCCELLS: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{Keyword | {{Keyword | ||
| | | | ||
Set the value of a cell range in an Office Calc document. The first string contains the file name of the Calc document (relative paths are possible). The second string contains the sheet name, and the third the cell range reference. The dimensions of the cell range must match the dimensions of the expression (scalar, [[vector]] or [[matrix]]). | 1= | ||
<code>SETCALCCELLS { [[expression]] , [[expression]] , [[expression]] , [[expression]] }</code> | |||
| | |||
2= | |||
Set the value of a cell range in an Office Calc document. The first string expression contains the file name of the Calc document (relative paths are possible). The second string expression contains the sheet name, and the third the cell range reference. The dimensions of the cell range must match the dimensions of the expression (scalar, [[vector]] or [[matrix]]). | |||
The Calc document is saved immediately after the change, during the recalculation of the iMath document. | The Calc document is saved immediately after the change, during the recalculation of the iMath document. | ||
| | | | ||
3= | |||
The following example will increment the value in cell <code>A1</code> of table <code>Tabelle1</code> in file <code>Unbenannt 1</code> at each iMath recalculation run. | |||
<code> | |||
EQDEF cell = "a1" | |||
EQDEF z = CALCCELL("Tabelle1", VAL(cell)) | |||
SETCALCCELL {"Unbenannt 1.ods", "Tabelle1", VAL(cell), VAL(z+1)} | |||
</code> | |||
Note that [[VAL]] is required here to create a string expression from the variable. | |||
| | | | ||
4= | |||
[[CALCCELL]] [[SETTABLECELL]] [[TABLECELL]] | [[CALCCELL]] [[SETTABLECELL]] [[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:08, 29 August 2018
Syntax
SETCALCCELLS { expression , 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 of a cell range in an Office Calc document. The first string expression contains the file name of the Calc document (relative paths are possible). The second string expression contains the sheet name, and the third the cell range reference. The dimensions of the cell range must match the dimensions of the expression (scalar, vector or matrix).
The Calc document is saved immediately after the change, during the recalculation of the iMath document.
Example
The following example will increment the value in cell A1
of table Tabelle1
in file Unbenannt 1
at each iMath recalculation run.
EQDEF cell = "a1"
EQDEF z = CALCCELL("Tabelle1", VAL(cell))
SETCALCCELL {"Unbenannt 1.ods", "Tabelle1", VAL(cell), VAL(z+1)}
Note that VAL is required here to create a string expression from the variable.