The ts_next() function

After a scan has been started with ts_begin_scan(), elements can be retrieved from the time series with ts_next().

Syntax

mi_integer 
ts_next(ts_tscan  *tscan, 
        ts_tselem *tselem)
tscan
The specified scan.
tselem
A pointer to an element that ts_next() fills in.

Description

On return, the ts_tselem contains the next element in the time series, if there is one.

When ts_tselem is valid, it can be passed to other routines in the time series API, such as ts_put_elem(), ts_get_col_by_name(), and ts_get_col_by_number().

Returns

TS_SCAN_ELEM
The tselem parameter contains a valid element.
TS_SCAN_NULL
The value in the element was NULL or hidden; if tselem is not NULL, then the element was hidden; otherwise, the element was NULL.
TS_SCAN_EOS
The scan has completed; tselem is not valid.

The return value must not be freed by the caller; it is freed when the scan is ended. It is overwritten after two ts_next() calls.

Example

See the ts_interp() function, The Interp function example, for an example of ts_next().