MemCom Reference Manual > MemCom C API Manual Pages > Sparse Table Functions > mcSTcellFindNext

Name

mcSTcellFindNext — Get the next non-empty sparse-table cell

Synopsis

#include <memcom.h>

mcInt64 mcSTcellFindNext(int dsid, int row_index, mcInt64 column_index);

Description

mcSTcellFindNext attempts to find, for the sparse-table dataset identified by dsid, the next non-empty cell, relative to the non-empty cell identified by the row index row_index and the column index column_index.

Using mcSTcellFindNext, one can efficiently iterate over all non-empty cells of a row.

Cells are in general not sorted inside a row (see mcSTrowSort). For unsorted rows, the column indices returned by mcSTcellFindNext are in the order by which the cells were added to the row.

Parameters

dsid (input)

Dataset identifier.

row_index (input)

Index of the row, starting at 1.

column_index (input)

Index of the column whose next non-empty cell is requested. Column indices start at 1. The column index must either be 0 or refer to a non-empty cell. If 0 is given, the first non-empty cell is requested.

Return Value

If no error occurred and the next non-empty cell exists, the column index of the next non-empty cell is returned (starting from 1). If such a cell does not exist, 0 is returned. If an error occurred, a negative value indicating the MemCom error number is returned.

See Also

mcSTcellNumElements

mcSTcellSize

mcSTcolAttributes

mcSTrowNumCells

mcSTrowSort