-----Original Message-----
From: Johnathan Smith [mailto:[EMAIL PROTECTED]]
Sent: Friday, 11 January 2002 8:11
To: Palm Developer Forum
Cc: [EMAIL PROTECTED]
Subject: Re: Sample using Category
> I found it hard to follow. Would you be willing to help?
In general the idea is the following:
You create a record, which get a default (0) category.
Then you use DmDataBaseInfo+DmSetDatabaseInfo to change the category
(located in lower 4 bits of the record attributes). The code looks like:
static const UInt16 MyCategory = 2;
UInt16 attr;
// Check the ref guid for the number of NULL - I could be wrong.
if (DmDatabaseInfo (cardNo, dbID, NULL, &attr,
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL) == 0)
{
attr = (attr & ~dmRecAttrCategoryMask) | MyCategory;
DmSetDatabaseInfo (UInt16 cardNo, LocalID dbID, NULL, &attr
NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL);
}
After that you can use DmQueryNextInCategory to read only records of
MyCategory:
Int16 index = 0;
MemHandle mh;
while ((mh = DmQueryNextInCategory (dbP, &index, MyCategory)) !=
NULL)
{
// Whatever
}
N.B. This does not work for resource data bases.
M.
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/