On 15 Jun 2001 13:01:12 -0500, Michael J. Hammel wrote:
> I've been trying to modify the attributes of individual records in order to
> attempt to delete and add new records using dlp_WriteRecord().  It doesn't
> work quite right for some reason, but this is what I have so far.
> 
> You must set the RecordID to 0 *and* set the attribute to modified (0x40)
> to add a new record.
> You must set the Attribute to deleted (0x80) to delete the record and then
> run dlp_CleanUpDatabase() to actually remove the record from the Pilot.
> 
> My problem is that if I read in a file of records to process that includes
> both deleted and modified records *and* new records, my db on the Pilot gets 
> messed up.  The process I use is:
> 
> dlp_OpenDB()
> Open file
> While more records
>       process a record with dlp_WriteRecord()
> dlp_CleanUpDatabase()
> dlp_ResetSyncFlags()
> dlp_CloseDB()
> 
> I'm using the 0.9.3 libpisock though 0.9.5 appears to have the same code in 
> this case (I haven't tried plugging it into my application though).  Is
> there a known issue with how records should be deleted and/or added when
> processed during the same session as records that are modified?

Please note while iterating through, you can NOT modify records in place
because they can be moved and this can screw you up.  This is how it
works for NextModifiedRecord any how (this fact is a one liner somewhere
in
http://www.palmos.com/dev/tech/docs/conduits/win/ConduitCompanionTOC.html. 
The 0.9.5 (well, pre code still i guess) sync.c code handles this.  In
fact, you may want to use this since it implements all the sync logic as
defined by palm.

-JP
--
--
=======================================================================
JP Rosevear                             [EMAIL PROTECTED]
Ximian Inc.                             http://www.ximian.com

_______________________________________________
Pilot-unix mailing list
[EMAIL PROTECTED]
http://hcirisc.cs.binghamton.edu/mailman/listinfo/pilot-unix

Reply via email to