Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM General » View Thread |
Messages 1 to 4 of 4 total |
FindLastKey (revisited) |
Wed, Mar 14 2007 10:54 AM | Permanent Link |
"Jose Eduardo Helminsky" | Tim
Sometime ago, I have asked to add a method in the TDBISamTable (and TEDBTable) to find the last occurrence of any fields. I know if I create a descending index works but if you can add this method it will be so nice. I don´t know how hard it could be but I know how much it will give us. RecordNumber Field1 Field2 1 1 Test one 2 1 Eduardo 3 1 Test two 4 2 Eduardo 5 2 Test three Table.FindKey([1]) will move the record pointer to record 1 Table.FindLastKey([1]) will move the record pointer to record 3 Eduardo |
Wed, Mar 14 2007 4:24 PM | Permanent Link |
Eryk Bottomley | Jose
> Table.FindLastKey([1]) will move the record pointer to record 3 Isn't this just: function TDBISAMTable.FindLastKey(const KeyValues: array of const) : Boolean; var Mark : TBookMark; begin Mark := GetBookMark; try SetRange(KeyValues,KeyValues); Result := not (Eof and Bof); {or maybe: Result := RecordCount > 0;} if Result then Last; CancelRange; if not Result then GotoBookMark(Mark); finally FreeBookMark(Mark); end; end; ....untested ...and I'm very rusty at that sort of thing. Eryk |
Thu, Mar 15 2007 6:11 AM | Permanent Link |
"Jose Eduardo Helminsky" | Eryk
I have been using a function (method) like this but I think it DBISAM just "walk" to the index is faster than this. BTW, thanks for your help. Eduardo |
Fri, Mar 16 2007 3:44 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Eduardo,
<< I have been using a function (method) like this but I think it DBISAM just "walk" to the index is faster than this. >> It would only be slightly faster. DBISAM would internally perform the same steps as you. -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Tuesday, September 17, 2024 at 04:19 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |