Mishael Kim wrote:

I'm pretty much new programing in palm, and was having trouble creating and storing information as a record.
After creating and opening a database, I tried using DmNewRecord to just save a boolean value and I'm having some trouble.
Any sample code? anyone? thanks in advance.


You don't say what type of trouble you are having, but the usual method goes something like this (off the top of my head... may be some typos)...
Note that this will find the first instance of a db that meets type/creator values. You may need to do more work to find the specific db to open if there are more than one match.


DmOpenRec    db=NULL;
MemHandle    recH=NULL;
UInt8        *recP;
UInt16      recIndex;
UInt16      recSize=<whatever you want>;

db=DmOpenDatabaseByTypeCreator(<the type of your db>, <creatorID of your db>, dmModeReadWrite);
recIndex=DmNumRecords(db);
recH=DmNewRecord(db, &recordIndex, recordSize);
if (recH){
recP=DmHandleLock(recH);
DmSet(recP,0,<Boolean value>, 1);
MemHandleUnlock(recH);
DmReleaseRecord(db, recIndex, true);
}


Bob.


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

Reply via email to