Paul,

Your code looks good on the surface.  The only oddity that I notice is that 
CurrentChoice needs to be Int32 when used in StrIToA and
needs to be UInt16 when used in DmRemoveRecord.  Thus, a guess is that the zero half 
of the Int32 is being used in DmRemoveRecord.
Try fixing this.

Keith Wolcott

Paul wrote:

> I'm having a problem with deleting a record.  I'm using a poplist to show
> the name from each record in a database.  After a name is choosen some of
> the record is displayed on the screen to verify the data. I want to allow
> the deletion of the choosen record by tapping a button.
>
> The code I'm using deletes only the 0 record from the poplist, not the
> selected one.  I'm even writing the CurrentChoice number to the screen to
> double check that the value is the one that I want.  If I choose the third
> item on my poplist the CurrentChoice number displayed to the screen is 2
> (since the poplist is zero indexed).   The record deleted is the first one
> on the list-zero.
>
> What am I missing about deleting the record I want to delete?
>
> Here is some of the code...
>
> CurrentChoice = Selection;  //Selection comes from LstGetSelection(ListPtr)
>
> StrIToA(temp,CurrentChoice);
> WinDrawChars(temp,StrLen(temp),25,65);
>
> localID  =  DmFindDatabase(0,"LData");
> if(localID != 0)
>         {
>         OpenRef = DmOpenDatabase(0,localID,dmModeReadWrite);
>         DmRemoveRecord(OpenRef,CurrentChoice);
>         DmCloseDatabase(OpenRef);
>         }
> ...
>
> Thanks for any help,
>
> Paul
>
> --
> 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/

Reply via email to