SETCALCCELLS

From iMath
Revision as of 13:49, 1 September 2018 by Jrheinlaender (talk | contribs)
Jump to navigation Jump to search

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("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.

See also

CALCCELL SETTABLECELL TABLECELL