mcDBgetSetNext — Get next set in database
#include <memcom.h> int mcDBgetSetNext(int handle, int poscod, mcSetAttributes* att);
mcDBgetSetNext
returns the attributes of
the next dataset in a database. The attributes are returned in a
structure of type mcSetAttributes
. The structure
must be declared by the calling function. If the next set exists,
the function returns 1 (true). If not, it returns 0 (false), meaning
that the last set has been encountered. The internal iterator can
become invalid (and must by considered invalid) after a call to a
MemCom function that insert, remove or rename a set on the database,
and after a mcDBpack
on the database.
handle
Database handle (input).
poscod
Dataset position code (input). If set to 0, the scan begins with the first dataset. If set to 1, the scan continues with the next set.
att
Dataset attributes returned by the function (input). The structure must be declared by the calling function.
mcDBgetSetNext
is usually called to get a
view of all dataset in the current file. The example below loops
over all datasets:
mcSetAttributes att; int poscod; int poscod = 0; /* gets first set */ while ( mcDBgetSetNext( handle, poscod, &att ) ) { /* do someting with att... */ poscod = 1; /* gets next set */ }