Re: DmFindSortPosition question

2002-12-19 Thread Matt Graham
christy wrote: I need to find a matching record from the databse (by fid and sid pair). If there is a match, I can subtract 1 from the return-value of DmFindSortPosition. However, how do I know that there is in fact no match for fid + sid pair? DmFindSortPosition tells me the next available positi

RE: DmFindSortPosition question

2002-12-17 Thread christy
0; > MemHanleUnlock(h); > } > } > > if (foundIt) > { > /* do whatever you want here */ > } > > > -Original Message- > From: christy [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, December 17, 2002 3:17 PM > To: Palm Developer

RE: DmFindSortPosition question

2002-12-17 Thread Robert McKenzie
ilto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 3:17 PM To: Palm Developer Forum Subject: RE: DmFindSortPosition question Very good point. I modified the code to have the two variables compare against each other. I need to find a matching record from the databse (by fid and sid pair). If

RE: DmFindSortPosition question

2002-12-17 Thread christy
Very good point. I modified the code to have the two variables compare against each other. I need to find a matching record from the databse (by fid and sid pair). If there is a match, I can subtract 1 from the return-value of DmFindSortPosition. However, how do I know that there is in fact no mat

RE: DmFindSortPosition question

2002-12-17 Thread Robert McKenzie
Just a guess, but because of possible wrapping / overflow problems, it is always safer to compare two values with each other rather than to subtract them and compare with 0. I.e. if (p1->fid < p2->fid) is better than if ((p1->fid - p2->fid) < 0) -Original Message- From: christy [mailt