QMReadNext() |
|
|
The QMReadNext() function retrieves the next entry from a select list. It is analogous to the QMBasic READNEXT statement.
Format
where
The QMReadNext() function retrieves the next entry from the select list identified by the ListNo argument.
If successful, the function returns the list entry and, in the Visual Basic and QMBasic APIs, Errno is set to SV_OK.
If the list is empty, the Visual Basic and QMBasic API functions return a null string and Errno is set to SV_ELSE. In the C API implementation, the function returns NULL.
See Select lists in QMClient sessions for a description of the alternative ways to handle select list with QMClient.
See also the QMReadList() function for a discussion of the relationship between QMReadNext() and QMReadList().
Note that in the C API library, the returned string is dynamically allocated. A loop containing a call to this function must free the memory from each call separately.
Examples
The above program fragment builds select list 1 and uses it to process records from the file open as fClients.
Note that the C example uses QMFree() to release dynamically allocated memory areas returned from QMClient API calls. |