CellUpdate (open)

Update a cell in a record

Syntax

// Core function, no LOADLIB necessary

RECORD FUNCTION CellUpdate(RECORD rec, STRING cellname, VARIANT newvalue)

Parameters

RECORD rec

Record to modify

STRING cellname

The name of the cell to update

VARIANT newvalue

The new value for the cell

Return value

RECORD

The record with the requested cell updated. Unlike the UPDATE statement, this function does not modify the original record passed in 'cellname'

Description

CellUpdate updates the specified cell in the record. Cell names are case-insensitive. UpdateCell can be used to update cells with a dynamically generated name.

If the cell does not exist in @italic rec, or @italic newvalue is of an incompatible type, an error is generated.

Examples

// Retrieve a file record, and add exclamation points to its title
RECORD myfile := FindFile(15);
myfile := CellUpdate(myfile, "title", myfile.title || "!!!");