QMNextPartial()

Top  Previous  Next

 

The QMNextPartial function returns the next part of a select list built using QMSelectPartial().

 

 

Format

 

VBQMNextPartial(ByVal ListNo) as String

 

Cvoid QMNextPartial(int ListNo)

 

ObjSession->NextPartial(ListNo)

 

where

 

ListNois the select list number (0 to 10).

 

 

The QMNextPartial() function provides an optimised way to process select lists within a QMClient session. It returns the next part of a list constructed using QMSelectPartial(). A null string is returned when the list is exhausted.

 

QMNextPartial() can also be used to return items from a select list built on the server by a program, by execution of a command, or by use of QMSelect(). It is essentially the same as a series of QMReadNext() operations that merge the ids into a single string before returning it to the server.

 

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

 

 

 

Examples

 

VB

List = QMSelectPartial(fClients, 1)

While List <> ""

  N = QMDcount(List, FM)

  For I = 1 To N

     Id = QMExtract(List, I, 0, 0)

     ...processing...

  Next I

  List = QMNextPartial(1)

Wend

C

List = QMSelectPartial(fClients, 1);

While(List != NULL)

{

 N = QMDcount(List, FM);

 For(I = 1; I <= N; I++)

  {

   Id = QMExtract(List, I, 0, 0);

   ...processing...

   QMFree(Id);

  }

 QMFree(List);

 List = QMNextPartial(1);

}

QMBasic

list = session->SelectPartial(fClients, 1)

loop

while list # ""

  for each id in list

     ...processing...

  next id

  list = session->NextPartial(1)

repeat

 

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.