>You can give each record one category.

>The categories are stored as part of the record's attribute byte. >This
>byte also stores stuff like whether the record is deleted, busy, or
>secret.

>You can get the byte with DmRecordInfo(). To set the category, you
>must change only the bits that correspond to the category. The >constant
>dmRectAttrCategoryMask indicates which bits those are. Once you >have
>adjusted the value of the byte without changing non-category bits, >you
>can update the record with DmSetRecordInfo().

>I found this to be a hassle, so I wrote convenience functions to >set
>and get the category of a record given its index and database >handle.

But how do I set the actual names? This is the part that I get confused on? So 
then if I have a element that I want to be in multible categories or sorted 
this way, I can't do? 

>Sure. If you call DmQuickSort() (or DmInsertionSort() or 
>>DmFindSortPosition()),
>you need to pass a callback function of type DmComparF. This >function is
>used to compare any two records and put them in the proper order. >And, in
>addition to pointers to the records, the function you supply gets >two
>SortRecordInfoPtr arguments. These contain the category >information. So,
>if you want to sort based on category, you just need to take that >information
>into account when comparing records in your comparison function.

Well seeing that record can only be in one category doesn't this limit my sort? 
How about if I want to sort on Name and Type? Or something like that?

How would I do this? Would I have to make a custom routine?


>> Do if I set these during my application run will effect the current ones?
>> Can I save them?

>I don't understand either of those questions. :-)

Sorry I ment, If I set these categories will they overwrite the current ones? 
Meaning the default Palm ones? Not sure if they are used by other apps? And can 
I save them if they are used by other apps so that I can restore them once my 
app is finished?

(sorry was rushing)

-- 
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to