Skip to content
Sheetwrite

@sheetwrite/formulas

setSparseCellsfunction

Report a problem

On this page

Write some cells of one rectangle with CellStore.setSparseBlock, with one text per cell. This function packs the text into the UTF-8 buffer and offsets that the store method takes; call the method itself only when you already hold text in that form.

Declaration

function setSparseCells(
store: Pick<WasmExports.CellStore, "setSparseBlock">,
sheet: number,
cells: SparseCellBlock,
): number

Parameters

store: Pick<WasmExports.CellStore, "setSparseBlock">required

The store to write to.

sheet: numberrequired

The sheet's handle, from addSheet.

cells: SparseCellBlockrequired

The rectangle and the cells to write in it.

Returns

number

The status of setSparseBlock: 0 written; 1 a bad shape or a rectangle outside the sheet; 2 a bad formula or reference offset; 3 a paged sheet with no room for the edit. Unless it is 0, nothing changed.

See also