QMReadList()

Top  Previous  Next

 

The QMReadList() function reads a select list into a dynamic array in the client application. It is analogous to the QMBasic READLIST statement.

 

 

Format

 

VBQMReadList(ByVal ListNo as Integer, ByRef Errno as Integer) as String

 

Cchar * QMReadList(int ListNo)

 

ObjStr = Session->ReadList(ListNo, Errno)

 

where

 

ListNois the number of the select list to be read in the range 0 to 10.

 

Errnoreceives an error value indicating the outcome of the request.

 

 

If the action is successful, the returned value contains a field mark delimited set of unprocessed entries from the given list. The original list is destroyed by this action.

 

The Visual Basic and object APIs returns an empty string if there is no data to read. The C API returns NULL in this situation.

 

See Select lists in QMClient sessions for a description of the alternative ways to handle select list with QMClient.

 

 

 

Examples

 

VB

QMSelect fClients, 1

List = QMReadList(1, ErrNo)

C

QMSelect(fClients, 1);

List = QMReadList(1);

QMBasic

session->Select(fClients, 1)

List = session->ReadList(1,  Errno)

 

The above program fragment builds select list 1 as a list of all records in the file open as fClients and then transfers this to a dynamic array named List.

 

Note that variable List in the C example points to a dynamically allocated memory area that must be released using QMFree() when no longer required.