[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[coldsync-hackers] p5-Palm insert Record




I am investigating how to insert records using p5-Palm, which currently allows
you to append_Record() only.  The functionality I'd like to duplicate is as
described in the PalmOS SDK document for DmNewRecord:

http://www.palmos.com/dev/tech/docs/palmos/DataAndResourceManager.html#940145

My knowledge of the Palm Data Manager is limited, so perhaps this is obvious to
someone.

Snippets of interest:

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Prototype 

MemHandle DmNewRecord (DmOpenRef dbP, UInt16 *atP, UInt32 size) 

Parameters 

 -> dbP  DmOpenRef to open database.


<-> atP  Pointer to index where new record should be placed. Specify
         the value dmMaxRecordIndex to add the record to the end of the
         database.


 -> size Size of new record.

Comments 

Allocates a new record of the given size, and returns a handle to the
record data. The parameter atP points to an index variable.  The new
record is inserted at index *atP and all record indices that follow
are shifted down. If *atP is greater than the number of records
currently in the database, the new record is appended to the end and
its index is returned in *atP.  Both the busy and dirty bits are set
for the new record and a unique ID is automatically created.
DmReleaseRecord should be called as soon as the caller finishes
viewing or editing the record.
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

What I'm interested in specifically is the atP "pointer to an index", and the
statement that subsequent record's indices are "shifted down" upon insertion.  I
haven't found an equivalent field in the Palm/PDB documentation (I'm pretty sure
it's not "offset"), and I'm not sure if it's trivially changeable.  

I'd like to be able to replicate such an insertion action which can be performed
on the Palm, by crafting a new PDB function "insert_Record()", which takes such
an index.  Inserting directly into or sorting the perl array @{$self->{records}}
doesn't seem to accomplish this.

Any suggestions, or thoughts?  

Thanks,

JD
This message was sent through the coldsync-hackers mailing list.  To remove
yourself from this mailing list, send a message to majordomo@thedotin.net
with the words "unsubscribe coldsync-hackers" in the message body.  For more
information on Coldsync, send mail to coldsync-hackers-owner@thedotin.net.