SETCALCCELLS: Difference between revisions
(Created page with "{{Keyword| <code>SETCALCCELLS ( string , string , string , expression )</code> | Set the value of a cell range in an Office Calc document. The first string con...") |
No edit summary |
||
(3 intermediate revisions by the same user not shown) | |||
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("Unbenannt 1.ods", "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. | |||
| | | | ||
[[CALCCELL] [[SETTABLECELL]] [[TABLECELL]] | 4= | ||
[[CALCCELL]] [[SETTABLECELL]] [[TABLECELL]] | |||
| | |||
5= | |||
2.2.0 or earlier. | |||
Up to version 2.2.6 only literal strings are allowed for file name, table name and cell reference, not string expressions | |||
}} | }} | ||
[[Category:Data exchange]] | [[Category:Data exchange]] |
Latest revision as of 17:02, 27 August 2024
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 for file name, table name and cell reference, 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("Unbenannt 1.ods", "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.