> Hi to all... I have been having a little trouble while trying to create a
> new record in a database... could someone be so polite of posting a basic
> code in order to create it, or at least which functions I should use to do
> so.
There's a couple of ways to do this. Here's one:
1. Figure out how many bytes are in the record.
2. Use DmNewRecord() to allocate a record with that many bytes. Set the
index to dmMaxRecordIndex to make the record show up at the end of the
records in the database. You'll get back both the handle of the new record,
and the index of the record in the database.
3. Use MemHandleLock() to lock the database record memory.
4. Use DmWrite() to write data into the record.
5. Use MemHandleUnlock() to unlock the memory handle.
6. Use DmReleaseRecord() to release the record in the database, and mark it
as "dirty".
For more assistance:
1. Look at the source code for the built-in applications, such as
Address.mcp.
2. Buy a Palm OS programming book (there's a recent thread here about book
recommendations).
3. Refer to the SDK for usage of specific functions.
4. Search the knowledge base.
Hope this introduction helps.
Jeff
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/