Tim,
Perhaps you meant to pass 'i' and not 'index' to DmReleaseRecord()?
> DmReleaseRecord(gFpurDB, index, true);
>
Your code will only release the record of 'index' that is passed to foo()
-Ken
> ----------
> From: Tim Astle[SMTP:[EMAIL PROTECTED]]
> Reply To: Palm Developer Forum
> Sent: Thursday, July 20, 2000 9:22 AM
> To: Palm Developer Forum
> Subject: Err Getting Rec - why?
>
> Hey guys, what could be causing this error? I'm using Palm OS 3.3 and the
> error is 5424: Err Getting Rec. Normally it's because of a busy record
> when
> the DmGetRecord is called, but I don't see how this is possible.
>
> This is the function that causes it:
>
>
> void foo(UInt index)
> {
> tblFpur theFpur;
> tblPackedFpurPtr p;
> VoidHand record;
> UInt numRec;
> Int i;
>
> // Get a count of the matching records
> numRec = CountFpurRecord(index);
>
> // Do a sort
> DmInsertionSort(gFpurDB, (DmComparF *)ComparePackedFpurRecord,
> index);
>
> // Knock the top record off repetitively until satisfied
> for(i = 0; i < numRec; i++)
> DmRemoveRecord(gFpurDB, 0);
>
> // Get a count of all the records in the database
> numRec = DmNumRecords(gFpurDB);
>
> for(i = 0; i < numRec; i++)
> {
> record = DmGetRecord(gFpurDB, i);
> p = MemHandleLock(record);
> UnpackFpur(&theFpur, p);
>
> // If the records deleted were under this record, drop it's ID
> by
> one
> if(theFpur.ID > index)
> {
> theFpur.ID -= 1;
> PackFpur(&theFpur, record);
> }
>
> MemHandleUnlock(record);
> DmReleaseRecord(gFpurDB, index, true);
> }
> }
>
> Thanks in advance!
>
> +++++++++++++
> Timothy D. Astle
> Embedded Systems Programmer
> ALT Group Inc.
> +++++++++++++
>
> People on Jolt cola write the funniest things.
>
> A-10 Obedience Guide,
> Kitty Hawk Studios
>
>
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
> please see http://www.palmos.com/dev/tech/support/forums/
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/