|
The QMNextPartial() function returns the next part of a select list built using QMSelectPartial().
The function takes one argument, ListNo as 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.
The example program fragment below builds select list 1 and uses it to process records from the file open as fClients.
char * QMNextPartial(int ListNo)
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);
}
\Note that the returned pointer references a dynamically allocated memory area that must be released using QMFree() when no longer needed as shown in this example.
|
QMNextPartial(ByVal ListNo as Integer) as String
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)
End While
|
NextPartial(ListNo)
list = session->SelectPartial(fClients, 1)
loop
while list # ""
for each id in list
...processing...
next id
list = session->NextPartial(1)
repeat
|
String NextPartial(int ListNo)
list = qm.SelectPartial(fClients, 1);
while qm.ServerError == SV$OK)
{
n = qm.Dcount(list, FM);
for(i = 1; i <= n; i++)
{
id = qm.Extract(list, i, 0, 0);
...processing...
}
list = qm.NextPartial(1);
}
|
NextPartial(ListNo)
list = qm.SelectPartial(fClients, 1)
while qm.ServerError == SV_OK:
n = qm.Dcount(list, FM)
for i in range(1, n+1):
id = qm.Extract(list, i, 0, 0)
...processing...
}
list = qm.NextPartial(1)
|
|