The mi_save_set_get_last() function

The mi_save_set_get_last() function retrieves the last row from a save set.

Syntax

MI_ROW *mi_save_set_get_last (save_set, error)
   MI_SAVE_SET *save_set;
   mi_integer *error;
save_set
A pointer to an MI_SAVE_SET structure.
error
A pointer to a return code.
Valid in client LIBMI application? Valid in user-defined routine?
Yes Yes

Usage

The mi_save_set_get_last() function obtains the last row from the save set that save_set references. Because the DataBlade® API maintains a save set as an FIFO (first-in, first-out) queue, the last row is the first row added to the save set; that is, it is the row at the end of the queue. This save set must have been previously created with the mi_save_set_create() function.

When the mi_save_set_get_last() function is successful, it returns a pointer to the row structure for the last row. It also moves the cursor position to point to the last row as the current row in the save set. If mi_save_set_get_last() cannot find the last row, the function takes the following steps:
  1. Returns the NULL-valued pointer
  2. Sets the error argument to MI_NO_MORE_RESULTS

Return values

An MI_ROW pointer
A pointer to the final row in the specified save set.
NULL
The function was not successful or the function cannot find the last row.