At 3:44 PM -0800 3/19/99, John Schettino wrote:
>This *seems* to work correctly, in that if *err is non-zero the
>MemHandleFree() executes without error. I'm just wondering if its
>*legal*. The docs, even the new 3.1 docs, are unclear on this point.
>It's sure a lot cleaner than allocating a record, deleting it if there's
>an error, and sorting the database when you're done.
What you're doing is fine.
As long as you don't call DmAttachRecord (or use DmNewRecord to get the
handle), you can use MemHandleFree to remove it. If the handle is attached
to a database, then you need to use DmRemoveRecord or DmDeleteRecord.
You're right, this is the smart way to insert a new record into a sorted
database.
--Bob