mcSTcellSetK — Set data for a character-string cell.
#include <memcom.h> int mcSTcellSetK(int dsid, int row_index, mcInt64 column_index, const char* data);
mcSTcellSetK
copies, for the sparse-table
dataset identified by dsid
, and for the cell
(whose column is of type "K"), identified by the row index
row_index
and the column index
column_index
, the data from the NUL-terminated
character string pointed to by data
, to the
cell's internal in-memory buffer.
mcSTcellSetK
ensures that the cell data
buffer always contains a terminating NUL-character. Hence, when
using mcSTcellGet, the
pointer returned (if any) always points to a NUL-terminated and thus
valid C string.
mcSTcellSetK
renders previously empty
cells non-empty. In this case, the row's sorting order will not be
maintained for reasons of computational efficiency. To sort the
non-empty cells inside the a row, use mcSTrowSort. To empty a cell, use
mcSTcellClear.
dsid (input)
Dataset identifier.
row_index (input)
Index of the row, starting at 1.
column_index (input)
Index of the column whose data is requested. Column indices start at 1.
data (input)
Pointer to a buffer in memory containing a
NUL-terminated character string which will define the new
cell data. MemCom will determine
the string length using the standard C
strlen
function. The length of the
string may be 0 (empty string).
For fixed-size columns, the string length plus one
must be smaller or equal to the column's
num_elements
attribute. Any remaining
bytes in the cell buffer will be padded with NUL
characters.
For variable-size columns the cell's new number of elements will be the string length plus one.